# HG changeset patch # Parent 7756e9125cddb61be83b956adc4d608c2d0923b3 Issue #25415: Remove public constructor restriction for IOBase etc This changes the documentation of IOBase, RawIOBase, BufferedIOBase and Text IOBase from saying "There is no public constructor" to "The constructor accepts no arguments". diff -r 7756e9125cdd Doc/library/io.rst --- a/Doc/library/io.rst Fri Oct 30 19:41:41 2015 -0400 +++ b/Doc/library/io.rst Sat Oct 31 11:36:20 2015 +0000 @@ -212,8 +212,8 @@ .. class:: IOBase - The abstract base class for all I/O classes, acting on streams of bytes. - There is no public constructor. + The abstract base class for all I/O classes. The constructor accepts no + arguments. This class provides empty abstract implementations for many methods that derived classes can override selectively; the default @@ -365,8 +365,8 @@ .. class:: RawIOBase - Base class for raw binary I/O. It inherits :class:`IOBase`. There is no - public constructor. + Base class for raw binary I/O. It inherits :class:`IOBase`. The + constructor accepts no arguments. Raw binary I/O typically provides low-level access to an underlying OS device or API, and does not try to encapsulate it in high-level primitives @@ -410,7 +410,7 @@ .. class:: BufferedIOBase Base class for binary streams that support some kind of buffering. - It inherits :class:`IOBase`. There is no public constructor. + It inherits :class:`IOBase`. The constructor accepts no arguments. The main difference with :class:`RawIOBase` is that methods :meth:`read`, :meth:`readinto` and :meth:`write` will try (respectively) to read as much @@ -731,7 +731,7 @@ Base class for text streams. This class provides a character and line based interface to stream I/O. There is no :meth:`readinto` method because Python's character strings are immutable. It inherits :class:`IOBase`. - There is no public constructor. + The constructor accepts no arguments. :class:`TextIOBase` provides or overrides these data attributes and methods in addition to those from :class:`IOBase`: diff -r 7756e9125cdd Lib/_pyio.py --- a/Lib/_pyio.py Fri Oct 30 19:41:41 2015 -0400 +++ b/Lib/_pyio.py Sat Oct 31 11:36:20 2015 +0000 @@ -282,8 +282,8 @@ class IOBase(metaclass=abc.ABCMeta): - """The abstract base class for all I/O classes, acting on streams of - bytes. There is no public constructor. + """The abstract base class for all I/O classes. The constructor accepts + no arguments. This class provides dummy implementations for many methods that derived classes can override selectively; the default implementations @@ -1729,7 +1729,7 @@ This class provides a character and line based interface to stream I/O. There is no readinto method because Python's character strings - are immutable. There is no public constructor. + are immutable. The constructor accepts no arguments. """ def read(self, size=-1): diff -r 7756e9125cdd Modules/_io/iobase.c --- a/Modules/_io/iobase.c Fri Oct 30 19:41:41 2015 -0400 +++ b/Modules/_io/iobase.c Sat Oct 31 11:36:20 2015 +0000 @@ -39,8 +39,8 @@ } iobase; PyDoc_STRVAR(iobase_doc, - "The abstract base class for all I/O classes, acting on streams of\n" - "bytes. There is no public constructor.\n" + "The abstract base class for all I/O classes. The constructor accepts\n" + "no arguments.\n" "\n" "This class provides dummy implementations for many methods that\n" "derived classes can override selectively; the default implementations\n" diff -r 7756e9125cdd Modules/_io/textio.c --- a/Modules/_io/textio.c Fri Oct 30 19:41:41 2015 -0400 +++ b/Modules/_io/textio.c Sat Oct 31 11:36:20 2015 +0000 @@ -53,7 +53,7 @@ "\n" "This class provides a character and line based interface to stream\n" "I/O. There is no readinto method because Python's character strings\n" - "are immutable. There is no public constructor.\n" + "are immutable. The constructor accepts no arguments.\n" ); static PyObject *