Skip to content
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

io.[Text]IOBase.seek doesn't take keyword parameter #69218

Closed
introom mannequin opened this issue Sep 8, 2015 · 6 comments
Closed

io.[Text]IOBase.seek doesn't take keyword parameter #69218

introom mannequin opened this issue Sep 8, 2015 · 6 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@introom
Copy link
Mannequin

introom mannequin commented Sep 8, 2015

BPO 25030
Nosy @ezio-melotti, @berkerpeksag, @vadmium
Files
  • seek.patch
  • 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 = 'https://github.com/vadmium'
    closed_at = <Date 2015-09-11.04:46:29.010>
    created_at = <Date 2015-09-08.13:44:41.571>
    labels = ['docs']
    title = "io.[Text]IOBase.seek doesn't take keyword parameter"
    updated_at = <Date 2015-09-11.04:46:29.009>
    user = 'https://bugs.python.org/introom'

    bugs.python.org fields:

    activity = <Date 2015-09-11.04:46:29.009>
    actor = 'martin.panter'
    assignee = 'martin.panter'
    closed = True
    closed_date = <Date 2015-09-11.04:46:29.010>
    closer = 'martin.panter'
    components = ['Documentation']
    creation = <Date 2015-09-08.13:44:41.571>
    creator = 'introom'
    dependencies = []
    files = ['40406']
    hgrepos = []
    issue_num = 25030
    keywords = ['patch']
    message_count = 6.0
    messages = ['250200', '250261', '250281', '250284', '250445', '250447']
    nosy_count = 6.0
    nosy_names = ['ezio.melotti', 'docs@python', 'python-dev', 'berker.peksag', 'martin.panter', 'introom']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue25030'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6']

    @introom
    Copy link
    Mannequin Author

    introom mannequin commented Sep 8, 2015

    The doc is here: https://docs.python.org/3.5/library/io.html#io.IOBase.seek
    and here: https://docs.python.org/3.5/library/io.html#io.TextIOBase.seek

    It is said the parameter list is in the form of:
    seek(offset, whence=SEEK_SET)

    But actually only:
    seek(offset) or seek(offset, whence) is allowed.

    Passing seek(offset, whence=SEEK_FOOBAR) will throw an error.

    The patch fixes the function signature as seek(offset[, whence])

    @introom introom mannequin assigned docspython Sep 8, 2015
    @introom introom mannequin added the docs Documentation in the Doc dir label Sep 8, 2015
    @vadmium
    Copy link
    Member

    vadmium commented Sep 8, 2015

    This also bugs me, and the same problem exists in other parts of the documentation. Perhaps you might be interested in bpo-23738 and whether changing to the new notation used by PEP-457, pydoc, help(), Argument Clinic is any good:

    seek(offset, whence=SEEK_SET, /)

    But in the mean time, I think the proposed patch is okay, and would certainly benefit the Python 2 documetation where using the new PEP-457 slash indicator is less likely to be appropriate.

    @introom
    Copy link
    Mannequin Author

    introom mannequin commented Sep 9, 2015

    Thanks for your comment.

    I had a read of PEP-457. It's still in draft status, so incorporating
    the / indicator is not much a concern AFAIK.

    Any further modification for me to do to get that merged?

    @introom introom mannequin changed the title io.[Text]IOBase.seek doesn't take keyword parameter io. Sep 9, 2015
    @vadmium
    Copy link
    Member

    vadmium commented Sep 9, 2015

    I will try to commit your patch today when I up to it.

    Maybe the “draft” status of that PEP is out of date. The slash (/) indicator is already being used in some places in pydoc, e.g.

    $ pydoc object.__eq__
    Help on wrapper_descriptor in object:
    object.__eq__ = __eq__(self, value, /)
        Return self==value.

    @vadmium vadmium changed the title io. io.[Text]IOBase.seek doesn't take keyword parameter Sep 9, 2015
    @vadmium vadmium assigned vadmium and unassigned docspython Sep 9, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Sep 11, 2015

    New changeset 0ca216f5276e by Martin Panter <vadmium> in branch '3.4':
    Issue bpo-25030: Do not document seek() as if it accepts keyword arguments
    https://hg.python.org/cpython/rev/0ca216f5276e

    New changeset 77784422da4d by Martin Panter <vadmium> in branch '2.7':
    Issue bpo-25030: Do not document seek() as if it accepts keyword arguments
    https://hg.python.org/cpython/rev/77784422da4d

    New changeset a0c6f5358029 by Martin Panter <vadmium> in branch '3.5':
    Issue bpo-25030: Merge seek() doc fixes from 3.4 into 3.5
    https://hg.python.org/cpython/rev/a0c6f5358029

    New changeset c4bb0da8b45e by Martin Panter <vadmium> in branch 'default':
    Issue bpo-25030: Merge seek() doc fixes from 3.5
    https://hg.python.org/cpython/rev/c4bb0da8b45e

    @vadmium
    Copy link
    Member

    vadmium commented Sep 11, 2015

    Thanks for the patch. I took the liberty of also fixing the doc string of BytesIO.seek().

    @vadmium vadmium closed this as completed Sep 11, 2015
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    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
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant