Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistake in python documentation related to escape sequences #95994

Closed
anupkaushal97 opened this issue Aug 15, 2022 · 2 comments
Closed

Mistake in python documentation related to escape sequences #95994

anupkaushal97 opened this issue Aug 15, 2022 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir triaged The issue has been accepted as valid by a triager.

Comments

@anupkaushal97
Copy link

anupkaushal97 commented Aug 15, 2022

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 anupkaushal97 added the docs Documentation in the Doc dir label Aug 15, 2022
@ronaldoussoren
Copy link
Contributor

ronaldoussoren commented Aug 15, 2022

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.

@erlend-aasland erlend-aasland added the triaged The issue has been accepted as valid by a triager. label Aug 15, 2022
ezio-melotti added a commit to ezio-melotti/cpython that referenced this issue Aug 18, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 26, 2022
* pythongh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit c3d591f)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
ezio-melotti added a commit that referenced this issue Aug 26, 2022
* gh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
miss-islington added a commit that referenced this issue Aug 26, 2022
* gh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
(cherry picked from commit c3d591f)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
ezio-melotti added a commit to ezio-melotti/cpython that referenced this issue Aug 28, 2022
* pythongh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit c3d591f)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
ezio-melotti added a commit that referenced this issue Aug 28, 2022
* gh-95994: clarify escaped newlines.

* Rephrase ambiguous sentence.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

* Use `<newline>` in escape sequences table.

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>.
(cherry picked from commit c3d591f)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir triaged The issue has been accepted as valid by a triager.
Projects
None yet
Development

No branches or pull requests

4 participants