Repository navigation
Closed
Labels
3.7 (EOL)end of lifedocsDocumentation in the Doc direasytype-featureA feature request or enhancement
Description
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']Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifedocsDocumentation in the Doc direasytype-featureA feature request or enhancement
Activity
gigaplastik commentedon Oct 19, 2014
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.
vadmium commentedon Dec 20, 2014
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.
vadmium commentedon Dec 22, 2014
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)
vadmium commentedon Apr 2, 2015
read-defaults.v3.patch:
serhiy-storchaka commentedon Oct 28, 2017
Do you mind to create a PR Martin?
vadmium commentedon Oct 29, 2017
I’m unlikely to soon, but I don’t mind if someone else uses my patch.
vstinner commentedon Dec 11, 2017
New changeset 1b74f9b by Victor Stinner (Sanyam Khurana) in branch 'master':
bpo-22671: Clarify and test default read method implementations (bpo-4568)
1b74f9b
vstinner commentedon Dec 11, 2017
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
vstinner commentedon Dec 11, 2017
Thank you Martin Panter and Sanyam Khurana for the fix.