bpo-33766: Document that end of file or string is a newline by ammaraskar ยท Pull Request #7383 ยท python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't require NEWS entries for small documentation patches, so I think this can be removed.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
Please check whether backporting to 2.7 makes sense, including "will an auto backport work with 3-line contexts, or is a separate PR needed?"
| used equally, regardless of platform. | ||
|
|
||
| The end of a file may also serve as a terminator for a physical line. This is | ||
| relevant when a file does not end with an end-of-line sequence. |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python source can be a string as will as a file, and strings are more likely to be missing \n. So I prefer 'Python input' or 'Python source' to 'a file'. I think 'source files' above should be 'source strings or files'.
I actually think the addition should be a single sentence added to the preceding paragraph.
"The end of input also acts as an implied end-of-line.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.
Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.
Thanks for the review Terry. I've adjusted the word in this and the previous paragraph to be more agnostic towards files and strings. I've also combined the change to the end of the previous paragraph.
Backport to 2.7 makes sense and should be able to be done automatically.
I have made the requested changes; please review again
Thanks for making the requested changes!
@terryjreedy: please review the changes made to this pull request.
Thanks @ammaraskar for the PR, and @terryjreedy for merging it ๐ฎ๐.. I'm working now to backport this PR to: 2.7, 3.6, 3.7.
๐๐โ๐ค
terryjreedy
changed the title
bpo-33766: Document edge case in parser involving end of file and new lines
bpo-33766: Document that end of file or string is a newline
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Jun 9, 2018miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Jun 9, 2018miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
Jun 9, 2018miss-islington added a commit that referenced this pull request
Jun 9, 2018(cherry picked from commit 0aa17ee) Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
miss-islington added a commit that referenced this pull request
Jun 10, 2018(cherry picked from commit 0aa17ee) Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
miss-islington added a commit that referenced this pull request
Jun 10, 2018(cherry picked from commit 0aa17ee) Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters