[Python-checkins] cpython (merge 3.2 -> default): Issue #12213: make it clear that BufferedRWPair shouldn't be called with the

antoine.pitrou python-checkins at python.org
Sat Aug 20 19:56:18 CEST 2011


http://hg.python.org/cpython/rev/a423bd492d6c
changeset:   71989:a423bd492d6c
parent:      71987:0fa18bc5427b
parent:      71988:524896c305ce
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sat Aug 20 19:50:32 2011 +0200
summary:
  Issue #12213: make it clear that BufferedRWPair shouldn't be called with the
same object as reader and writer, and deemphasize it in document order.

files:
  Doc/library/io.rst |  42 ++++++++++++++++++---------------
  1 files changed, 23 insertions(+), 19 deletions(-)


diff --git a/Doc/library/io.rst b/Doc/library/io.rst
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -607,25 +607,6 @@
       if the buffer needs to be written out but the raw stream blocks.
 
 
-.. class:: BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE)
-
-   A buffered I/O object giving a combined, higher-level access to two
-   sequential :class:`RawIOBase` objects: one readable, the other writeable.
-   It is useful for pairs of unidirectional communication channels
-   (pipes, for instance).  It inherits :class:`BufferedIOBase`.
-
-   *reader* and *writer* are :class:`RawIOBase` objects that are readable and
-   writeable respectively.  If the *buffer_size* is omitted it defaults to
-   :data:`DEFAULT_BUFFER_SIZE`.
-
-   A fourth argument, *max_buffer_size*, is supported, but unused and
-   deprecated.
-
-   :class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods
-   except for :meth:`~BufferedIOBase.detach`, which raises
-   :exc:`UnsupportedOperation`.
-
-
 .. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE)
 
    A buffered interface to random access streams.  It inherits
@@ -642,6 +623,29 @@
    :class:`BufferedWriter` can do.
 
 
+.. class:: BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE)
+
+   A buffered I/O object combining two unidirectional :class:`RawIOBase`
+   objects -- one readable, the other writeable -- into a single bidirectional
+   endpoint.  It inherits :class:`BufferedIOBase`.
+
+   *reader* and *writer* are :class:`RawIOBase` objects that are readable and
+   writeable respectively.  If the *buffer_size* is omitted it defaults to
+   :data:`DEFAULT_BUFFER_SIZE`.
+
+   A fourth argument, *max_buffer_size*, is supported, but unused and
+   deprecated.
+
+   :class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods
+   except for :meth:`~BufferedIOBase.detach`, which raises
+   :exc:`UnsupportedOperation`.
+
+   .. warning::
+      :class:`BufferedRWPair` does not attempt to synchronize accesses to
+      its underlying raw streams.  You should not pass it the same object
+      as reader and writer; use :class:`BufferedRandom` instead.
+
+
 Text I/O
 ^^^^^^^^
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list