[issue35848] readinto is not a method on io.TextIOBase

Steve Palmer report at bugs.python.org
Wed Jan 30 03:37:30 EST 2019


Steve Palmer <steve at srpalmer.me.uk> added the comment:

I don't have a "real" use case.  I discovered the issue when I was developing a unittest suite for what it means to be "file-like".  I've been codifying the description in the standard library and exercising my tests against the built-in file-likes, such as the io.StringIO class, when it raised the Attribute Exception.

The more I think about it, the more like a documentation problem it feels.  For example, the statement "... because their signatures will vary ..." does not apply to readinto in the cases where it is defined.

For completeness, the note in io.TextIOBase stating "There is no readinto() method because Python’s character strings are immutable." would also need to be removed as part of a documentation fix.

(It's also nice when solutions result in less "stuff". :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35848>
_______________________________________


More information about the Python-bugs-list mailing list