This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Typo in specifying escape sequence
Type: Stage: resolved
Components: Documentation Versions: Python 3.10
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ilovedexter, serhiy.storchaka, steven.daprano, zach.ware
Priority: normal Keywords:

Created on 2022-01-07 14:37 by ilovedexter, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg409967 - (view) Author: Preetham Nanjappa (ilovedexter) Date: 2022-01-07 14:37
See section "2.4.1. String and Bytes literals" of 3.10.1 documentation.
https://docs.python.org/3.10/reference/lexical_analysis.html#string-and-bytes-literals

Escape Sequence table. First line.

`\newline` should have been `\n`
msg409971 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2022-01-07 14:42
No, it is a backslash following by a newline.
msg409972 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2022-01-07 14:59
Serhiy is correct. The table is correct, \n can be found further down the table, the first entry is backslash newline, as it says.
msg409979 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2022-01-07 16:01
The table could stand some clarification; `\newline` is the only example that is not showing exactly the characters that one would see when looking at source code and which doesn't have an explanatory note.  There's also the additional wrinkle that `\CR`, `\LF`, and `\CRLF` are treated the same, which might be an important detail in the reference section.

I don't have a great suggestion to offer, though.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90451
2022-01-07 16:01:46zach.waresetnosy: + zach.ware
messages: + msg409979
2022-01-07 14:59:59steven.dapranosetstatus: open -> closed

nosy: + steven.daprano
messages: + msg409972

resolution: not a bug
stage: resolved
2022-01-07 14:42:49serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg409971
2022-01-07 14:37:58ilovedextercreate