Skip to content

Typo in the Python Tutorial #122876

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

Closed
Flyagin opened this issue Aug 10, 2024 · 6 comments
Closed

Typo in the Python Tutorial #122876

Flyagin opened this issue Aug 10, 2024 · 6 comments
Labels
docs Documentation in the Doc dir easy

Comments

@Flyagin
Copy link

Flyagin commented Aug 10, 2024

Documentation

In "The Python Tutorial", chapter "3. An Informal Introduction to Python", section "3.1.2. Text", in the 3rd sentence of the 2nd paragraph under the 4th example, the following phrase contains a typo:

"End of lines are automatically included in the string"

Should be: "Ends of lines ..." (the letter 's' after "End" is missing).

Linked PRs

@Flyagin Flyagin added the docs Documentation in the Doc dir label Aug 10, 2024
@picnixz
Copy link
Member

picnixz commented Aug 10, 2024

Not sure whether it's a typo or not if we are expanding the technical term "EOLs" as in "End-of-line [character sequence]s" (note the fact that I am using dashes here to make EOL a single word).

@AA-Turner Do you think we should put an "s" at "end" here? (possibly adding dashes to make a single word and not three?) Instinctively I would have said "no" but I am now unsure.

@AA-Turner
Copy link
Member

Using 'End of line characters' here seems appropriate, but otherwise I agree with the description in the issue.

A

@Flyagin
Copy link
Author

Flyagin commented Aug 10, 2024

Here is a similar sentence with 's' in "ends of lines" occurring in a similar context in another place of the docs (this is in the version 3.8 though, -- newer versions contain neither "end of lines", nor "ends of lines"):

"The default is to consider only \n characters as ends of lines and to do no newline translation." (3.8.19 Documentation » The Python Standard Library » Generic Operating System Services » io — Core tools for working with streams).

@terryjreedy
Copy link
Member

terryjreedy commented Aug 10, 2024

Without checking the context, "An end-of-line character is added ..." EDIT might work.

@Flyagin
Copy link
Author

Flyagin commented Aug 11, 2024

Without checking the context, "An end-of-line character is added ..." EDIT might work.

@AA-Turner proposed the same phrase, but in plural: 'End of line characters'. I think that plural is more appropriate here, isn't it? Here is how this phrase occurs in the context:

String literals can span multiple lines. One way is using triple-quotes: """...""" or '''...'''. End of lines are automatically included in the string, but it’s possible to prevent this by adding a \ at the end of the line. (The Python Tutorial, § 3.1.2. Text).

@picnixz mentioned another similar term, "End-of-line [character sequence]s". In The Python Language Reference both terms occur:

A physical line is a sequence of characters terminated by an end-of-line sequence (emphasis mine). (The Python Language Reference, § 2.1.2. Physical lines)

Two or more physical lines may be joined into logical lines using backslash characters (\), as follows: when a physical line ends in a backslash that is not part of a string literal or comment, it is joined with the following forming a single logical line, deleting the backslash and the following end-of-line character (emphasis mine). (The Python Language Reference, § 2.1.5. Explicit line joining)

So which term is better in this situation (i.e. in The Python Tutorial), 1) "end-of-line character", 2) "end-of-line characters", 3) "end-of-line sequence", 4) "end-of-line sequences"?

Finally, unlike The Python Language Reference, The Python Tutorial is meant to be less formal, and none of the four terms mentioned in the previous paragraph occur there, so maybe "ends of lines" would be better because this term is less formal?

@hugovk hugovk added the easy label Sep 9, 2024
za added a commit to za/cpython that referenced this issue Oct 11, 2024
@Ko496-glitch
Copy link

@Flyagin is this still open because i would like to take on this issue.

hugovk added a commit that referenced this issue Feb 19, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 19, 2025
(cherry picked from commit 7380186)

Co-authored-by: za <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 19, 2025
(cherry picked from commit 7380186)

Co-authored-by: za <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk added a commit that referenced this issue Feb 19, 2025
@hugovk hugovk closed this as completed Feb 19, 2025
hugovk added a commit that referenced this issue Feb 19, 2025
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 easy
Projects
None yet
Development

No branches or pull requests

6 participants