Skip to content

io.[Text]IOBase.seek doesn't take keyword parameter - revisited #85864

Description

@andy-maier
mannequin
BPO 41698
Nosy @methane, @andy-maier, @tomerv

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:

assignee = None
closed_at = None
created_at = <Date 2020-09-03.01:32:40.652>
labels = ['3.8', 'docs']
title = "io.[Text]IOBase.seek doesn't take keyword parameter - revisited"
updated_at = <Date 2021-10-21.05:52:51.694>
user = 'https://github.com/andy-maier'

bugs.python.org fields:

activity = <Date 2021-10-21.05:52:51.694>
actor = 'tomerv'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2020-09-03.01:32:40.652>
creator = 'andymaier'
dependencies = []
files = []
hgrepos = []
issue_num = 41698
keywords = []
message_count = 5.0
messages = ['376272', '376273', '376274', '376277', '404569']
nosy_count = 4.0
nosy_names = ['methane', 'docs@python', 'andymaier', 'tomerv']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue41698'
versions = ['Python 3.8']

Activity

  1. andy-maier commented on Sep 3, 2020

    andy-maiermannequin
    MannequinAuthor

    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?

  2. methane commented on Sep 3, 2020

    @methane
    Member

    For the record, https://github.com/python/cpython/pull/14691/files reintroduced whence=SEEK_SET.

  3. methane commented on Sep 3, 2020

    @methane
    Member

    Since we have positional-only argument, can we document it as seek(offset, whence=SEEK_SET, /)?

  4. andy-maier commented on Sep 3, 2020

    andy-maiermannequin
    MannequinAuthor

    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, /).

  5. tomerv commented on Oct 21, 2021

    tomervmannequin
    Mannequin

    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.

  6. transferred this issue fromon Apr 10, 2022
  7. added a commit that references this issue on Apr 23, 2022
  8. added a commit that references this issue on Apr 23, 2022
  9. added a commit that references this issue on Apr 23, 2022
  10. added a commit that references this issue on Apr 23, 2022
  11. added 2 commits that reference this issue on Apr 23, 2022
  12. added 3 commits that reference this issue on Apr 30, 2022
  13. JelleZijlstra commented on Apr 30, 2022

    @JelleZijlstra
    Member

    Thanks for the patches @slateny!

  14. added 2 commits that reference this issue on Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.8 (EOL)end of lifedocsDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions