cpython icon indicating copy to clipboard operation
cpython copied to clipboard

Mistake in python documentation related to escape sequences

Open anupkaushal97 opened this issue 3 years ago • 1 comments

Escape_Sequences There is mistake related to escape sequences in Python documentation page link: https://docs.python.org/3/reference/lexical_analysis.html#strings

it shows "\newline" with meaning "Backslash and newline ignored" while using this has no effect in code

print('Hello \newline World!')

outputs: Hello ewline World!

anupkaushal97 avatar Aug 15 '22 10:08 anupkaushal97

The documentation could be clearer here, but what's meant is a literal newline, that is:

s = "foo \
bar"

Here the backslash and the newline after it are ignored.

ronaldoussoren avatar Aug 15 '22 11:08 ronaldoussoren

Fixed, thanks for the report!

  • [x] #96066
  • [x] #96321
  • [x] #96360

ezio-melotti avatar Aug 28 '22 13:08 ezio-melotti