~ubuntu-branches/ubuntu/raring/python3.2/raring

« back to all changes in this revision

Viewing changes to Doc/library/io.rst

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-09-05 22:01:13 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: package-import@ubuntu.com-20110905220113-gmku3knwah89ojat
Tags: 3.2.2-0ubuntu1
* Python 3.2.2 release.
* Search headers in /usr/include/ncursesw for the curses/panel extensions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
607
607
      if the buffer needs to be written out but the raw stream blocks.
608
608
 
609
609
 
 
610
.. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE)
 
611
 
 
612
   A buffered interface to random access streams.  It inherits
 
613
   :class:`BufferedReader` and :class:`BufferedWriter`, and further supports
 
614
   :meth:`seek` and :meth:`tell` functionality.
 
615
 
 
616
   The constructor creates a reader and writer for a seekable raw stream, given
 
617
   in the first argument.  If the *buffer_size* is omitted it defaults to
 
618
   :data:`DEFAULT_BUFFER_SIZE`.
 
619
 
 
620
   A third argument, *max_buffer_size*, is supported, but unused and deprecated.
 
621
 
 
622
   :class:`BufferedRandom` is capable of anything :class:`BufferedReader` or
 
623
   :class:`BufferedWriter` can do.
 
624
 
 
625
 
610
626
.. class:: BufferedRWPair(reader, writer, buffer_size=DEFAULT_BUFFER_SIZE)
611
627
 
612
 
   A buffered I/O object giving a combined, higher-level access to two
613
 
   sequential :class:`RawIOBase` objects: one readable, the other writeable.
614
 
   It is useful for pairs of unidirectional communication channels
615
 
   (pipes, for instance).  It inherits :class:`BufferedIOBase`.
 
628
   A buffered I/O object combining two unidirectional :class:`RawIOBase`
 
629
   objects -- one readable, the other writeable -- into a single bidirectional
 
630
   endpoint.  It inherits :class:`BufferedIOBase`.
616
631
 
617
632
   *reader* and *writer* are :class:`RawIOBase` objects that are readable and
618
633
   writeable respectively.  If the *buffer_size* is omitted it defaults to
625
640
   except for :meth:`~BufferedIOBase.detach`, which raises
626
641
   :exc:`UnsupportedOperation`.
627
642
 
628
 
 
629
 
.. class:: BufferedRandom(raw, buffer_size=DEFAULT_BUFFER_SIZE)
630
 
 
631
 
   A buffered interface to random access streams.  It inherits
632
 
   :class:`BufferedReader` and :class:`BufferedWriter`, and further supports
633
 
   :meth:`seek` and :meth:`tell` functionality.
634
 
 
635
 
   The constructor creates a reader and writer for a seekable raw stream, given
636
 
   in the first argument.  If the *buffer_size* is omitted it defaults to
637
 
   :data:`DEFAULT_BUFFER_SIZE`.
638
 
 
639
 
   A third argument, *max_buffer_size*, is supported, but unused and deprecated.
640
 
 
641
 
   :class:`BufferedRandom` is capable of anything :class:`BufferedReader` or
642
 
   :class:`BufferedWriter` can do.
 
643
   .. warning::
 
644
      :class:`BufferedRWPair` does not attempt to synchronize accesses to
 
645
      its underlying raw streams.  You should not pass it the same object
 
646
      as reader and writer; use :class:`BufferedRandom` instead.
643
647
 
644
648
 
645
649
Text I/O