-
-
Notifications
You must be signed in to change notification settings - Fork 32k
io.[Text]IOBase.seek doesn't take keyword parameter - revisited #85864
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
Comments
I stumbled across the problem reported in https://bugs.python.org/issue25030 on Python 3.8: >>> with open('x.txt', 'a') as fp:
... fp.seek(0, whence=os.SEEK_END)
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
TypeError: seek() takes no keyword arguments Which I coded with a keyword argument because the documentation says so: seek(offset, whence=SEEK_SET) See https://docs.python.org/3.8/library/io.html#io.IOBase.seek The fix for issue bpo-25030 changed the documentation to: seek(offset[, whence]) and supposedly was integrated into 2.7, 3.4, and the default branch back then. It seems the fix got lost? |
For the record, https://github.com/python/cpython/pull/14691/files reintroduced |
Since we have positional-only argument, can we document it as |
Thanks for referencing the PR that reintroduced the old way of documenting it. From my perspective, the proposal is fine. There are already some cases where it is documented like that, e.g. str.removeprefix(prefix, /). |
Just wanted to add that I encountered this today, went to file a ticket, and found this one. I'm fine with either style of documentation. |
(cherry picked from commit a3f2cf3) Co-authored-by: slateny <[email protected]>
…91683). (cherry picked from commit a3f2cf3) Co-authored-by: slateny <[email protected]>
(cherry picked from commit a3f2cf3) Co-authored-by: slateny <[email protected]>
) (cherry picked from commit a3f2cf3) Co-authored-by: slateny <[email protected]>
…GH-91950) (cherry picked from commit 3a8e2b6) Co-authored-by: slateny <[email protected]>
(cherry picked from commit 3a8e2b6) Co-authored-by: slateny <[email protected]>
(cherry picked from commit 3a8e2b6) Co-authored-by: slateny <[email protected]>
Thanks for the patches @slateny! |
…91683). (python#91848) (cherry picked from commit a3f2cf3) Co-authored-by: slateny <[email protected]>
…GH-91950) (cherry picked from commit 3a8e2b6) Co-authored-by: slateny <[email protected]>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: