[docs] [issue25415] I can create instances of io.IOBase

Martin Panter report at bugs.python.org
Sat Oct 31 07:40:02 EDT 2015


Martin Panter added the comment:

If existing subclasses like FileIO call the base, that is an implementation detail. But custom subclasses of the Raw, Buffered, and Text base classes should not be prohibited from chain calling the base’s __init__() method, nor should they have to override __init__() if there is no special initialization to be done. For IOBase itself, I don’t see a strong argument either way, but it makes sense to keep it consistent with the other three base classes.

I propose this patch, which changes “There is no public constructor” to “The constructor accepts no arguments”. In my mind this blesses making custom subclasses, which already seems to be tested and used in practice.

----------
keywords: +patch
stage:  -> patch review
versions: +Python 2.7, Python 3.4, Python 3.6
Added file: http://bugs.python.org/file40908/no-args.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25415>
_______________________________________


More information about the docs mailing list