summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-10-27 13:20:10 (GMT)
committerGeorg Brandl <georg@python.org>2009-10-27 13:20:10 (GMT)
commit4f8084eda1b13c58c1ec87276120877f1a154477 (patch)
tree476032b6b12ae41208ca6b8a4b78e541f6428420 /Doc
parent0d97d32a868f37020658dc40be908913722ca696 (diff)
downloadcpython-4f8084eda1b13c58c1ec87276120877f1a154477.zip
cpython-4f8084eda1b13c58c1ec87276120877f1a154477.tar.gz
cpython-4f8084eda1b13c58c1ec87276120877f1a154477.tar.bz2
Merged revisions 68776-68777 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68776 | benjamin.peterson | 2009-01-19 17:17:54 +0100 (Mo, 19 Jan 2009) | 1 line move BufferedIOBase into the base class section ........ r68777 | benjamin.peterson | 2009-01-19 17:18:27 +0100 (Mo, 19 Jan 2009) | 1 line add email address ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/io.rst106
-rw-r--r--Doc/library/symtable.rst2
2 files changed, 54 insertions, 54 deletions
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index cccbb26..49c2abe 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -329,59 +329,6 @@ I/O Base Classes
``len(b)``, since if the write fails, an :exc:`IOError` will be raised).
-Raw File I/O
-------------
-
-.. class:: FileIO(name[, mode])
-
- :class:`FileIO` represents a file containing bytes data. It implements
- the :class:`RawIOBase` interface (and therefore the :class:`IOBase`
- interface, too).
-
- The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing,
- or appending. The file will be created if it doesn't exist when opened for
- writing or appending; it will be truncated when opened for writing. Add a
- ``'+'`` to the mode to allow simultaneous reading and writing.
-
- In addition to the attributes and methods from :class:`IOBase` and
- :class:`RawIOBase`, :class:`FileIO` provides the following data
- attributes and methods:
-
- .. attribute:: mode
-
- The mode as given in the constructor.
-
- .. attribute:: name
-
- The file name. This is the file descriptor of the file when no name is
- given in the constructor.
-
- .. method:: read([n])
-
- Read and return at most *n* bytes. Only one system call is made, so it is
- possible that less data than was requested is returned. Use :func:`len`
- on the returned bytes object to see how many bytes were actually returned.
- (In non-blocking mode, ``None`` is returned when no data is available.)
-
- .. method:: readall()
-
- Read and return the entire file's contents in a single bytes object. As
- much as immediately available is returned in non-blocking mode. If the
- EOF has been reached, ``b''`` is returned.
-
- .. method:: write(b)
-
- Write the bytes or bytearray object, *b*, to the file, and return
- the number actually written. Only one system call is made, so it
- is possible that only some of the data is written.
-
- Note that the inherited ``readinto()`` method should not be used on
- :class:`FileIO` objects.
-
-
-Buffered Streams
-----------------
-
.. class:: BufferedIOBase
Base class for streams that support buffering. It inherits :class:`IOBase`.
@@ -439,6 +386,59 @@ Buffered Streams
underlying raw stream cannot accept more data at the moment.
+Raw File I/O
+------------
+
+.. class:: FileIO(name[, mode])
+
+ :class:`FileIO` represents a file containing bytes data. It implements
+ the :class:`RawIOBase` interface (and therefore the :class:`IOBase`
+ interface, too).
+
+ The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing,
+ or appending. The file will be created if it doesn't exist when opened for
+ writing or appending; it will be truncated when opened for writing. Add a
+ ``'+'`` to the mode to allow simultaneous reading and writing.
+
+ In addition to the attributes and methods from :class:`IOBase` and
+ :class:`RawIOBase`, :class:`FileIO` provides the following data
+ attributes and methods:
+
+ .. attribute:: mode
+
+ The mode as given in the constructor.
+
+ .. attribute:: name
+
+ The file name. This is the file descriptor of the file when no name is
+ given in the constructor.
+
+ .. method:: read([n])
+
+ Read and return at most *n* bytes. Only one system call is made, so it is
+ possible that less data than was requested is returned. Use :func:`len`
+ on the returned bytes object to see how many bytes were actually returned.
+ (In non-blocking mode, ``None`` is returned when no data is available.)
+
+ .. method:: readall()
+
+ Read and return the entire file's contents in a single bytes object. As
+ much as immediately available is returned in non-blocking mode. If the
+ EOF has been reached, ``b''`` is returned.
+
+ .. method:: write(b)
+
+ Write the bytes or bytearray object, *b*, to the file, and return
+ the number actually written. Only one system call is made, so it
+ is possible that only some of the data is written.
+
+ Note that the inherited ``readinto()`` method should not be used on
+ :class:`FileIO` objects.
+
+
+Buffered Streams
+----------------
+
.. class:: BytesIO([initial_bytes])
A stream implementation using an in-memory bytes buffer. It inherits
diff --git a/Doc/library/symtable.rst b/Doc/library/symtable.rst
index ee24823..28306e6 100644
--- a/Doc/library/symtable.rst
+++ b/Doc/library/symtable.rst
@@ -5,7 +5,7 @@
:synopsis: Interface to the compiler's internal symbol tables.
.. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu>
-.. sectionauthor:: Benjamin Peterson
+.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
Symbol tables are generated by the compiler from AST just before bytecode is