cpython
cpython copied to clipboard
Mistake in python documentation related to 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!
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.
Fixed, thanks for the report!
- [x] #96066
- [x] #96321
- [x] #96360