Skip to content

Typo in class io.BufferedIOBase docs #66861

Closed

Description

@gigaplastik
BPO 22671
Nosy @pitrou, @vstinner, @berkerpeksag, @vadmium, @serhiy-storchaka, @chkumar246
PRs
  • bpo-22671: Clarify and test default read method implementations #4568
  • [3.6] bpo-22671: Clarify and test default read method implementations (GH-4568) #4796
  • bpo-22671: Fix issue22671 make patchcheck #4818
  • Files
  • read-defaults.patch
  • read-defaults.v2.patch
  • read-defaults.v3.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 2017-12-11.14:28:11.082>
    created_at = <Date 2014-10-19.09:35:52.237>
    labels = ['easy', 'type-feature', '3.7', 'docs']
    title = 'Typo in class io.BufferedIOBase docs'
    updated_at = <Date 2017-12-12.18:18:22.493>
    user = 'https://bugs.python.org/gigaplastik'

    bugs.python.org fields:

    activity = <Date 2017-12-12.18:18:22.493>
    actor = 'CuriousLearner'
    assignee = 'martin.panter'
    closed = True
    closed_date = <Date 2017-12-11.14:28:11.082>
    closer = 'vstinner'
    components = ['Documentation']
    creation = <Date 2014-10-19.09:35:52.237>
    creator = 'gigaplastik'
    dependencies = []
    files = ['37515', '37528', '38798']
    hgrepos = []
    issue_num = 22671
    keywords = ['patch', 'easy']
    message_count = 9.0
    messages = ['229677', '232970', '233029', '239863', '305159', '305172', '308042', '308044', '308045']
    nosy_count = 8.0
    nosy_names = ['pitrou', 'vstinner', 'docs@python', 'berker.peksag', 'martin.panter', 'serhiy.storchaka', 'gigaplastik', 'chkumar246']
    pr_nums = ['4568', '4796', '4818']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue22671'
    versions = ['Python 3.6', 'Python 3.7']

    Activity

    1. gigaplastik commented on Oct 19, 2014

      gigaplastikmannequin
      MannequinAuthor

      The online documentation for class io.BufferedIOBase states the following:

      "Besides, the read() method does not have a default implementation that defers to readinto()."

      According to the documentation for class io.RawIOBase (which the statement compares with) read() method actually defers to readall(), NOT readinto() as misleadingly stated.
      The same typo is present in help('io.BufferedIOBase') output and, very likely, in all 3.X line docs for this class.

    2. added
      docs
      type-feature
      on Oct 19, 2014
    3. vadmium commented on Dec 20, 2014

      @vadmium
      Member

      The documentation was technically correct but too scanty. RawIOBase.read(-1) does defer to readall(), but with a proper size passed, it defers to readinto() instead. Here is a patch which hopefully clarifies this, and also explains which methods have a usable default implementation. Includes some tests for RawIOBase and BufferedIOBase which didn’t seem to be there already.

    4. vadmium commented on Dec 22, 2014

      @vadmium
      Member

      Adding patch v2 with readinto1() as a “mixin method” and dropped many of my earlier changes for better consistency with the introduction of the classes (which I never really read before :P)

    5. vadmium commented on Apr 2, 2015

      @vadmium
      Member

      read-defaults.v3.patch:

      • Split off test_RawIOBase_readall()
      • Changed BufferedIOBase tests to matrix of tuples
      • Added tests for empty buffer
      • Test that unused part of buffer remains untouched
    6. serhiy-storchaka commented on Oct 28, 2017

      @serhiy-storchaka
      Member

      Do you mind to create a PR Martin?

    7. vadmium commented on Oct 29, 2017

      @vadmium
      Member

      I’m unlikely to soon, but I don’t mind if someone else uses my patch.

    8. vstinner commented on Dec 11, 2017

      @vstinner
      Member

      New changeset 1b74f9b by Victor Stinner (Sanyam Khurana) in branch 'master':
      bpo-22671: Clarify and test default read method implementations (bpo-4568)
      1b74f9b

    9. vstinner commented on Dec 11, 2017

      @vstinner
      Member

      New changeset 0aa2a1d by Victor Stinner (Miss Islington (bot)) in branch '3.6':
      bpo-22671: Clarify and test default read method implementations (GH-4568) (bpo-4796)
      0aa2a1d

    10. vstinner commented on Dec 11, 2017

      @vstinner
      Member

      Thank you Martin Panter and Sanyam Khurana for the fix.

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)docseasytype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions