[3.7] bpo-37635: Update arg name for seek() in IO tutorial (GH-16147) #16151
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Typically, the second positional argument for
seek()
is whence. That is the POSIX standard name (http://man7.org/linux/man-pages/man3/lseek.3p.html) and the name listed in the documentation forio
module (https://docs.python.org/3/library/io.htmlGH-io.IOBase.seek).The tutorial for IO is the only location where the second positional argument for
seek()
is referred to as from_what. I suspect this was created at an early point in Python's history, and was never updated (as this section predates the GitHub repository):For consistency, I am suggesting that the tutorial be updated to use the same argument name as the IO documentation and POSIX standard for
seek()
, particularly since this is the only location where from_what is being used.Note: In the POSIX standard, whence is technically the third positional argument, but the first argument fildes (file descriptor) is implicit in Python.
https://bugs.python.org/issue37635
(cherry picked from commit ff603f6)
Co-authored-by: Kyle Stanley aeros167@gmail.com
https://bugs.python.org/issue37635
Automerge-Triggered-By: @pitrou