Kaydet (Commit) 9efcc4b3 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

Fix problems in the io docs noted by Alexandre Vassalotti

üst e0313f20
...@@ -437,12 +437,12 @@ Buffered Streams ...@@ -437,12 +437,12 @@ Buffered Streams
.. method:: read1() .. method:: read1()
In :class:`BytesIO`, this is the same as :meth:`read()`. In :class:`BytesIO`, this is the same as :meth:`read`.
.. method:: truncate([pos]) .. method:: truncate([pos])
Truncate the file to at most *pos* bytes. *pos* defaults to the current Truncate the file to at most *pos* bytes. *pos* defaults to the current
stream position, as returned by :meth:`tell()`. stream position, as returned by :meth:`tell`.
.. class:: BufferedReader(raw[, buffer_size]) .. class:: BufferedReader(raw[, buffer_size])
......
""" """The io module provides the Python interfaces to stream handling. The
The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module. builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It At the top of the I/O hierarchy is the abstract base class IOBase. It
...@@ -78,8 +77,7 @@ class BlockingIOError(IOError): ...@@ -78,8 +77,7 @@ class BlockingIOError(IOError):
def open(file, mode="r", buffering=None, encoding=None, errors=None, def open(file, mode="r", buffering=None, encoding=None, errors=None,
newline=None, closefd=True): newline=None, closefd=True):
r""" r"""Open file and return a stream. If the file cannot be opened, an
Open file and return a stream. If the file cannot be opened, an
IOError is raised. IOError is raised.
file is either a string giving the name (and the path if the file file is either a string giving the name (and the path if the file
...@@ -287,8 +285,7 @@ class UnsupportedOperation(ValueError, IOError): ...@@ -287,8 +285,7 @@ class UnsupportedOperation(ValueError, IOError):
class IOBase(metaclass=abc.ABCMeta): class IOBase(metaclass=abc.ABCMeta):
""" """The abstract base class for all I/O classes, acting on streams of
The abstract base class for all I/O classes, acting on streams of
bytes. There is no public constructor. bytes. There is no public constructor.
This class provides dummy implementations for many methods that This class provides dummy implementations for many methods that
...@@ -793,7 +790,7 @@ class BytesIO(BufferedIOBase): ...@@ -793,7 +790,7 @@ class BytesIO(BufferedIOBase):
return bytes(b) return bytes(b)
def read1(self, n): def read1(self, n):
"""In BytesIO, this is the same as read. """This is the same as read.
""" """
return self.read(n) return self.read(n)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment