[docs] [issue21763] Clarify requirements for file-like objects

Nikolaus Rath report at bugs.python.org
Sun Jun 15 20:50:41 CEST 2014

Nikolaus Rath added the comment:

On 06/15/2014 08:29 AM, R. David Murray wrote:
> I don't think that's true, though.  "file like" pretty much means "has the file attributes that I actually use".  That is, it is context dependent (duck typing).

Well, but when you pass your file-like object to some function from the
standard library, you don't know what file attributes will be used. So
to make sure that things work as expected, you have to make sure that
your file-like object behaves as prescribed by the IOBase* classes.

> I'm also not sure I see the point in the change.  It is inherent in the definition of what ABCs are. 

True. But not everyone reading the io documentation is familiar enough
with ABCs to immediately make that mental translation.


Python tracker <report at bugs.python.org>

More information about the docs mailing list