[Python-checkins] r84829 - in python/branches/py3k/Doc: faq/design.rst library/aifc.rst library/array.rst library/asyncore.rst library/base64.rst library/bz2.rst library/configparser.rst library/csv.rst library/email.generator.rst library/email.parser.rst library/exceptions.rst library/filesys.rst library/formatter.rst library/ftplib.rst library/gettext.rst library/gzip.rst library/http.client.rst library/imp.rst library/mmap.rst library/nntplib.rst library/os.rst library/pickle.rst library/quopri.rst library/select.rst library/stdtypes.rst library/subprocess.rst library/sys.rst library/tarfile.rst library/tempfile.rst library/termios.rst library/weakref.rst library/xml.etree.elementtree.rst tutorial/inputoutput.rst

antoine.pitrou python-checkins at python.org
Wed Sep 15 13:11:28 CEST 2010


Author: antoine.pitrou
Date: Wed Sep 15 13:11:28 2010
New Revision: 84829

Log:
Add cross-references to the glossary entry for file objects.



Modified:
   python/branches/py3k/Doc/faq/design.rst
   python/branches/py3k/Doc/library/aifc.rst
   python/branches/py3k/Doc/library/array.rst
   python/branches/py3k/Doc/library/asyncore.rst
   python/branches/py3k/Doc/library/base64.rst
   python/branches/py3k/Doc/library/bz2.rst
   python/branches/py3k/Doc/library/configparser.rst
   python/branches/py3k/Doc/library/csv.rst
   python/branches/py3k/Doc/library/email.generator.rst
   python/branches/py3k/Doc/library/email.parser.rst
   python/branches/py3k/Doc/library/exceptions.rst
   python/branches/py3k/Doc/library/filesys.rst
   python/branches/py3k/Doc/library/formatter.rst
   python/branches/py3k/Doc/library/ftplib.rst
   python/branches/py3k/Doc/library/gettext.rst
   python/branches/py3k/Doc/library/gzip.rst
   python/branches/py3k/Doc/library/http.client.rst
   python/branches/py3k/Doc/library/imp.rst
   python/branches/py3k/Doc/library/mmap.rst
   python/branches/py3k/Doc/library/nntplib.rst
   python/branches/py3k/Doc/library/os.rst
   python/branches/py3k/Doc/library/pickle.rst
   python/branches/py3k/Doc/library/quopri.rst
   python/branches/py3k/Doc/library/select.rst
   python/branches/py3k/Doc/library/stdtypes.rst
   python/branches/py3k/Doc/library/subprocess.rst
   python/branches/py3k/Doc/library/sys.rst
   python/branches/py3k/Doc/library/tarfile.rst
   python/branches/py3k/Doc/library/tempfile.rst
   python/branches/py3k/Doc/library/termios.rst
   python/branches/py3k/Doc/library/weakref.rst
   python/branches/py3k/Doc/library/xml.etree.elementtree.rst
   python/branches/py3k/Doc/tutorial/inputoutput.rst

Modified: python/branches/py3k/Doc/faq/design.rst
==============================================================================
--- python/branches/py3k/Doc/faq/design.rst	(original)
+++ python/branches/py3k/Doc/faq/design.rst	Wed Sep 15 13:11:28 2010
@@ -210,8 +210,8 @@
 is hidden at the bottom of the loop.
 
 The best approach is to use iterators, making it possible to loop through
-objects using the ``for`` statement.  For example, in the current version of
-Python file objects support the iterator protocol, so you can now write simply::
+objects using the ``for`` statement.  For example, :term:`file objects
+<file object>` support the iterator protocol, so you can write simply::
 
    for line in f:
        ... # do something with line...

Modified: python/branches/py3k/Doc/library/aifc.rst
==============================================================================
--- python/branches/py3k/Doc/library/aifc.rst	(original)
+++ python/branches/py3k/Doc/library/aifc.rst	Wed Sep 15 13:11:28 2010
@@ -40,10 +40,10 @@
 .. function:: open(file, mode=None)
 
    Open an AIFF or AIFF-C file and return an object instance with methods that are
-   described below.  The argument *file* is either a string naming a file or a file
-   object.  *mode* must be ``'r'`` or ``'rb'`` when the file must be opened for
-   reading, or ``'w'``  or ``'wb'`` when the file must be opened for writing.  If
-   omitted, ``file.mode`` is used if it exists, otherwise ``'rb'`` is used.  When
+   described below.  The argument *file* is either a string naming a file or a
+   :term:`file object`.  *mode* must be ``'r'`` or ``'rb'`` when the file must be
+   opened for reading, or ``'w'``  or ``'wb'`` when the file must be opened for writing.
+   If omitted, ``file.mode`` is used if it exists, otherwise ``'rb'`` is used.  When
    used for writing, the file object should be seekable, unless you know ahead of
    time how many samples you are going to write in total and use
    :meth:`writeframesraw` and :meth:`setnframes`.

Modified: python/branches/py3k/Doc/library/array.rst
==============================================================================
--- python/branches/py3k/Doc/library/array.rst	(original)
+++ python/branches/py3k/Doc/library/array.rst	Wed Sep 15 13:11:28 2010
@@ -147,11 +147,11 @@
 
 .. method:: array.fromfile(f, n)
 
-   Read *n* items (as machine values) from the file object *f* and append them to
-   the end of the array.  If less than *n* items are available, :exc:`EOFError` is
-   raised, but the items that were available are still inserted into the array.
-   *f* must be a real built-in file object; something else with a :meth:`read`
-   method won't do.
+   Read *n* items (as machine values) from the :term:`file object` *f* and append
+   them to the end of the array.  If less than *n* items are available,
+   :exc:`EOFError` is raised, but the items that were available are still
+   inserted into the array. *f* must be a real built-in file object; something
+   else with a :meth:`read` method won't do.
 
 
 .. method:: array.fromlist(list)
@@ -214,7 +214,7 @@
 
 .. method:: array.tofile(f)
 
-   Write all items (as machine values) to the file object *f*.
+   Write all items (as machine values) to the :term:`file object` *f*.
 
 
 .. method:: array.tolist()

Modified: python/branches/py3k/Doc/library/asyncore.rst
==============================================================================
--- python/branches/py3k/Doc/library/asyncore.rst	(original)
+++ python/branches/py3k/Doc/library/asyncore.rst	Wed Sep 15 13:11:28 2010
@@ -225,9 +225,9 @@
 
 .. class:: file_dispatcher()
 
-   A file_dispatcher takes a file descriptor or file object along with an
-   optional map argument and wraps it for use with the :cfunc:`poll` or
-   :cfunc:`loop` functions.  If provided a file object or anything with a
+   A file_dispatcher takes a file descriptor or :term:`file object` along
+   with an optional map argument and wraps it for use with the :cfunc:`poll`
+   or :cfunc:`loop` functions.  If provided a file object or anything with a
    :cfunc:`fileno` method, that method will be called and passed to the
    :class:`file_wrapper` constructor.  Availability: UNIX.
 

Modified: python/branches/py3k/Doc/library/base64.rst
==============================================================================
--- python/branches/py3k/Doc/library/base64.rst	(original)
+++ python/branches/py3k/Doc/library/base64.rst	Wed Sep 15 13:11:28 2010
@@ -122,9 +122,9 @@
 .. function:: decode(input, output)
 
    Decode the contents of the binary *input* file and write the resulting binary
-   data to the *output* file. *input* and *output* must either be file objects
-   or objects that mimic the file object interface working with bytes
-   objects. *input* will be read until ``input.read()`` returns an empty string.
+   data to the *output* file. *input* and *output* must be :term:`file objects
+   <file object>`. *input* will be read until ``input.read()`` returns an empty
+   bytes object.
 
 
 .. function:: decodebytes(s)
@@ -138,11 +138,10 @@
 .. function:: encode(input, output)
 
    Encode the contents of the binary *input* file and write the resulting base64
-   encoded data to the *output* file. *input* and *output* must either be file
-   objects or objects that mimic the file object interface working with bytes
-   objects. *input* will be read until ``input.read()`` returns an empty string.
-   :func:`encode` returns the encoded data plus a trailing newline character
-   (``b'\n'``).
+   encoded data to the *output* file. *input* and *output* must be :term:`file
+   objects <file object>`. *input* will be read until ``input.read()`` returns
+   an empty bytes object. :func:`encode` returns the encoded data plus a trailing
+   newline character (``b'\n'``).
 
 
 .. function:: encodebytes(s)

Modified: python/branches/py3k/Doc/library/bz2.rst
==============================================================================
--- python/branches/py3k/Doc/library/bz2.rst	(original)
+++ python/branches/py3k/Doc/library/bz2.rst	Wed Sep 15 13:11:28 2010
@@ -25,8 +25,8 @@
 
 * :class:`BZ2File` class implements universal newline support;
 
-* :class:`BZ2File` class offers an optimized line iteration using the readahead
-  algorithm borrowed from file objects;
+* :class:`BZ2File` class offers an optimized line iteration using a readahead
+  algorithm;
 
 * Sequential (de)compression supported by :class:`BZ2Compressor` and
   :class:`BZ2Decompressor` classes;

Modified: python/branches/py3k/Doc/library/configparser.rst
==============================================================================
--- python/branches/py3k/Doc/library/configparser.rst	(original)
+++ python/branches/py3k/Doc/library/configparser.rst	Wed Sep 15 13:11:28 2010
@@ -422,7 +422,7 @@
 
 .. method:: RawConfigParser.write(fileobject, space_around_delimiters=True)
 
-   Write a representation of the configuration to the specified file object,
+   Write a representation of the configuration to the specified :term:`file object`,
    which must be opened in text mode (accepting strings).  This representation
    can be parsed by a future :meth:`read` call. If ``space_around_delimiters``
    is ``True`` (the default), delimiters between keys and values are surrounded

Modified: python/branches/py3k/Doc/library/csv.rst
==============================================================================
--- python/branches/py3k/Doc/library/csv.rst	(original)
+++ python/branches/py3k/Doc/library/csv.rst	Wed Sep 15 13:11:28 2010
@@ -50,9 +50,9 @@
 
    Return a reader object which will iterate over lines in the given *csvfile*.
    *csvfile* can be any object which supports the :term:`iterator` protocol and returns a
-   string each time its :meth:`!next` method is called --- file objects and list
-   objects are both suitable.   If *csvfile* is a file object, it should be opened
-   with ``newline=''``. [#]_  An optional
+   string each time its :meth:`!next` method is called --- :term:`file objects
+   <file object>` and list objects are both suitable.   If *csvfile* is a file object,
+   it should be opened with ``newline=''``. [#]_  An optional
    *dialect* parameter can be given which is used to define a set of parameters
    specific to a particular CSV dialect.  It may be an instance of a subclass of
    the :class:`Dialect` class or one of the strings returned by the

Modified: python/branches/py3k/Doc/library/email.generator.rst
==============================================================================
--- python/branches/py3k/Doc/library/email.generator.rst	(original)
+++ python/branches/py3k/Doc/library/email.generator.rst	Wed Sep 15 13:11:28 2010
@@ -28,9 +28,9 @@
 
 .. class:: Generator(outfp, mangle_from_=True, maxheaderlen=78)
 
-   The constructor for the :class:`Generator` class takes a file-like object called
-   *outfp* for an argument.  *outfp* must support the :meth:`write` method and be
-   usable as the output file for the :func:`print` function.
+   The constructor for the :class:`Generator` class takes a :term:`file-like object`
+   called *outfp* for an argument.  *outfp* must support the :meth:`write` method
+   and be usable as the output file for the :func:`print` function.
 
    Optional *mangle_from_* is a flag that, when ``True``, puts a ``>`` character in
    front of any line in the body that starts exactly as ``From``, i.e. ``From``

Modified: python/branches/py3k/Doc/library/email.parser.rst
==============================================================================
--- python/branches/py3k/Doc/library/email.parser.rst	(original)
+++ python/branches/py3k/Doc/library/email.parser.rst	Wed Sep 15 13:11:28 2010
@@ -154,9 +154,9 @@
 
 .. function:: message_from_file(fp[, _class][, strict])
 
-   Return a message object structure tree from an open file object.  This is
-   exactly equivalent to ``Parser().parse(fp)``.  Optional *_class* and *strict*
-   are interpreted as with the :class:`Parser` class constructor.
+   Return a message object structure tree from an open :term:`file object`.
+   This is exactly equivalent to ``Parser().parse(fp)``.  Optional *_class*
+   and *strict* are interpreted as with the :class:`Parser` class constructor.
 
 Here's an example of how you might use this at an interactive Python prompt::
 

Modified: python/branches/py3k/Doc/library/exceptions.rst
==============================================================================
--- python/branches/py3k/Doc/library/exceptions.rst	(original)
+++ python/branches/py3k/Doc/library/exceptions.rst	Wed Sep 15 13:11:28 2010
@@ -134,8 +134,8 @@
 .. exception:: IOError
 
    Raised when an I/O operation (such as the built-in :func:`print` or
-   :func:`open` functions or a method of a file object) fails for an I/O-related
-   reason, e.g., "file not found" or "disk full".
+   :func:`open` functions or a method of a :term:`file object`) fails for an
+   I/O-related reason, e.g., "file not found" or "disk full".
 
    This class is derived from :exc:`EnvironmentError`.  See the discussion above
    for more information on exception instance attributes.

Modified: python/branches/py3k/Doc/library/filesys.rst
==============================================================================
--- python/branches/py3k/Doc/library/filesys.rst	(original)
+++ python/branches/py3k/Doc/library/filesys.rst	Wed Sep 15 13:11:28 2010
@@ -27,8 +27,8 @@
 .. seealso::
 
    Module :mod:`os`
-      Operating system interfaces, including functions to work with files at a lower
-      level than the built-in file object.
+      Operating system interfaces, including functions to work with files at a
+      lower level than Python :term:`file objects <file object>`.
 
    Module :mod:`io`
       Python's built-in I/O library, including both abstract classes and

Modified: python/branches/py3k/Doc/library/formatter.rst
==============================================================================
--- python/branches/py3k/Doc/library/formatter.rst	(original)
+++ python/branches/py3k/Doc/library/formatter.rst	Wed Sep 15 13:11:28 2010
@@ -339,8 +339,8 @@
 
 .. class:: DumbWriter(file=None, maxcol=72)
 
-   Simple writer class which writes output on the file object passed in as *file*
-   or, if *file* is omitted, on standard output.  The output is simply word-wrapped
-   to the number of columns specified by *maxcol*.  This class is suitable for
-   reflowing a sequence of paragraphs.
+   Simple writer class which writes output on the :term:`file object` passed
+   in as *file* or, if *file* is omitted, on standard output.  The output is
+   simply word-wrapped to the number of columns specified by *maxcol*.  This
+   class is suitable for reflowing a sequence of paragraphs.
 

Modified: python/branches/py3k/Doc/library/ftplib.rst
==============================================================================
--- python/branches/py3k/Doc/library/ftplib.rst	(original)
+++ python/branches/py3k/Doc/library/ftplib.rst	Wed Sep 15 13:11:28 2010
@@ -245,12 +245,12 @@
 .. method:: FTP.storbinary(cmd, file, blocksize=8192, callback=None, rest=None)
 
    Store a file in binary transfer mode.  *cmd* should be an appropriate
-   ``STOR`` command: ``"STOR filename"``. *file* is an open file object which is
-   read until EOF using its :meth:`read` method in blocks of size *blocksize* to
-   provide the data to be stored.  The *blocksize* argument defaults to 8192.
-   *callback* is an optional single parameter callable that is called
-   on each block of data after it is sent. *rest* means the same thing as in
-   the :meth:`transfercmd` method.
+   ``STOR`` command: ``"STOR filename"``. *file* is an open :term:`file object`
+   which is read until EOF using its :meth:`read` method in blocks of size
+   *blocksize* to provide the data to be stored.  The *blocksize* argument
+   defaults to 8192.  *callback* is an optional single parameter callable that
+   is called on each block of data after it is sent. *rest* means the same thing
+   as in the :meth:`transfercmd` method.
 
    .. versionchanged:: 3.2
       *rest* parameter added.
@@ -260,8 +260,8 @@
 
    Store a file in ASCII transfer mode.  *cmd* should be an appropriate
    ``STOR`` command (see :meth:`storbinary`).  Lines are read until EOF from the
-   open file object *file* using its :meth:`readline` method to provide the data to
-   be stored.  *callback* is an optional single parameter callable
+   open :term:`file object` *file* using its :meth:`readline` method to provide
+   the data to be stored.  *callback* is an optional single parameter callable
    that is called on each line after it is sent.
 
 

Modified: python/branches/py3k/Doc/library/gettext.rst
==============================================================================
--- python/branches/py3k/Doc/library/gettext.rst	(original)
+++ python/branches/py3k/Doc/library/gettext.rst	Wed Sep 15 13:11:28 2010
@@ -173,8 +173,8 @@
    associated :file:`.mo` file paths.  Instances with identical :file:`.mo` file
    names are cached.  The actual class instantiated is either *class_* if
    provided, otherwise :class:`GNUTranslations`.  The class's constructor must
-   take a single file object argument.  If provided, *codeset* will change the
-   charset used to encode translated strings in the :meth:`lgettext` and
+   take a single :term:`file object` argument.  If provided, *codeset* will change
+   the charset used to encode translated strings in the :meth:`lgettext` and
    :meth:`lngettext` methods.
 
    If multiple files are found, later files are used as fallbacks for earlier ones.
@@ -219,7 +219,7 @@
 
 .. class:: NullTranslations(fp=None)
 
-   Takes an optional file object *fp*, which is ignored by the base class.
+   Takes an optional :term:`file object` *fp*, which is ignored by the base class.
    Initializes "protected" instance variables *_info* and *_charset* which are set
    by derived classes, as well as *_fallback*, which is set through
    :meth:`add_fallback`.  It then calls ``self._parse(fp)`` if *fp* is not

Modified: python/branches/py3k/Doc/library/gzip.rst
==============================================================================
--- python/branches/py3k/Doc/library/gzip.rst	(original)
+++ python/branches/py3k/Doc/library/gzip.rst	Wed Sep 15 13:11:28 2010
@@ -9,10 +9,9 @@
 
 The data compression is provided by the :mod:`zlib` module.
 
-The :mod:`gzip` module provides the :class:`GzipFile` class which is modeled
-after Python's File Object. The :class:`GzipFile` class reads and writes
-:program:`gzip`\ -format files, automatically compressing or decompressing the
-data so that it looks like an ordinary file object.
+The :mod:`gzip` module provides the :class:`GzipFile` class. The :class:`GzipFile`
+class reads and writes :program:`gzip`\ -format files, automatically compressing
+or decompressing the data so that it looks like an ordinary :term:`file object`.
 
 Note that additional file formats which can be decompressed by the
 :program:`gzip` and :program:`gunzip` programs, such  as those produced by
@@ -27,7 +26,7 @@
 .. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)
 
    Constructor for the :class:`GzipFile` class, which simulates most of the methods
-   of a file object, with the exception of the :meth:`readinto` and
+   of a :term:`file object`, with the exception of the :meth:`readinto` and
    :meth:`truncate` methods.  At least one of *fileobj* and *filename* must be
    given a non-trivial value.
 

Modified: python/branches/py3k/Doc/library/http.client.rst
==============================================================================
--- python/branches/py3k/Doc/library/http.client.rst	(original)
+++ python/branches/py3k/Doc/library/http.client.rst	Wed Sep 15 13:11:28 2010
@@ -367,7 +367,7 @@
    object.  The Content-Length header is set to the length of the
    string.
 
-   The *body* may also be an open file object, in which case the
+   The *body* may also be an open :term:`file object`, in which case the
    contents of the file is sent; this file object should support
    ``fileno()`` and ``read()`` methods. The header Content-Length is
    automatically set to the length of the file as reported by

Modified: python/branches/py3k/Doc/library/imp.rst
==============================================================================
--- python/branches/py3k/Doc/library/imp.rst	(original)
+++ python/branches/py3k/Doc/library/imp.rst	Wed Sep 15 13:11:28 2010
@@ -48,8 +48,8 @@
    If search is successful, the return value is a 3-element tuple ``(file,
    pathname, description)``:
 
-   *file* is an open file object positioned at the beginning, *pathname* is the
-   pathname of the file found, and *description* is a 3-element tuple as
+   *file* is an open :term:`file object` positioned at the beginning, *pathname*
+   is the pathname of the file found, and *description* is a 3-element tuple as
    contained in the list returned by :func:`get_suffixes` describing the kind of
    module found.
 

Modified: python/branches/py3k/Doc/library/mmap.rst
==============================================================================
--- python/branches/py3k/Doc/library/mmap.rst	(original)
+++ python/branches/py3k/Doc/library/mmap.rst	Wed Sep 15 13:11:28 2010
@@ -5,14 +5,13 @@
    :synopsis: Interface to memory-mapped files for Unix and Windows.
 
 
-Memory-mapped file objects behave like both :class:`bytes` and like file
-objects. Unlike normal :class:`bytes` objects, however, these are mutable.
-You can use mmap objects in most places where :class:`bytes` are expected; for
-example, you can use the :mod:`re` module to search through a memory-mapped file.
-Since they're mutable, you can change a single byte by doing ``obj[index] = 97``,
-or change a subsequence by assigning to a slice: ``obj[i1:i2] = b'...'``.
-You can also read and write data starting at the current file position, and
-:meth:`seek` through the file to different positions.
+Memory-mapped file objects behave like both :class:`bytearray` and like
+:term:`file objects <file object>`.  You can use mmap objects in most places
+where :class:`bytearray` are expected; for example, you can use the :mod:`re`
+module to search through a memory-mapped file.  You can also change a single
+byte by doing ``obj[index] = 97``, or change a subsequence by assigning to a
+slice: ``obj[i1:i2] = b'...'``.  You can also read and write data starting at
+the current file position, and :meth:`seek` through the file to different positions.
 
 A memory-mapped file is created by the :class:`mmap` constructor, which is
 different on Unix and on Windows.  In either case you must provide a file

Modified: python/branches/py3k/Doc/library/nntplib.rst
==============================================================================
--- python/branches/py3k/Doc/library/nntplib.rst	(original)
+++ python/branches/py3k/Doc/library/nntplib.rst	Wed Sep 15 13:11:28 2010
@@ -143,9 +143,9 @@
    *groups* is a list of group names that are new since the given date and time. If
    the *file* parameter is supplied, then the output of the  ``NEWGROUPS`` command
    is stored in a file.  If *file* is a string,  then the method will open a file
-   object with that name, write to it  then close it.  If *file* is a file object,
-   then it will start calling :meth:`write` on it to store the lines of the command
-   output. If *file* is supplied, then the returned *list* is an empty list.
+   object with that name, write to it  then close it.  If *file* is a :term:`file
+   object`, then it will start calling :meth:`write` on it to store the lines of
+   the command output. If *file* is supplied, then the returned *list* is an empty list.
 
 
 .. method:: NNTP.newnews(group, date, time, [file])
@@ -155,9 +155,9 @@
    ``(response, articles)`` where *articles* is a list of message ids. If the
    *file* parameter is supplied, then the output of the  ``NEWNEWS`` command is
    stored in a file.  If *file* is a string,  then the method will open a file
-   object with that name, write to it  then close it.  If *file* is a file object,
-   then it will start calling :meth:`write` on it to store the lines of the command
-   output. If *file* is supplied, then the returned *list* is an empty list.
+   object with that name, write to it  then close it.  If *file* is a :term:`file
+   object`, then it will start calling :meth:`write` on it to store the lines of the
+   command output. If *file* is supplied, then the returned *list* is an empty list.
 
 
 .. method:: NNTP.list([file])
@@ -169,9 +169,9 @@
    not, and ``'m'`` if the newsgroup is moderated.  (Note the ordering: *last*,
    *first*.) If the *file* parameter is supplied, then the output of the  ``LIST``
    command is stored in a file.  If *file* is a string,  then the method will open
-   a file object with that name, write to it  then close it.  If *file* is a file
-   object, then it will start calling :meth:`write` on it to store the lines of the
-   command output. If *file* is supplied, then the returned *list* is an empty
+   a file with that name, write to it  then close it.  If *file* is a :term:`file
+   object`, then it will start calling :meth:`write` on it to store the lines of
+   the command output. If *file* is supplied, then the returned *list* is an empty
    list.
 
 
@@ -207,8 +207,8 @@
    Send a ``HELP`` command.  Return a pair ``(response, list)`` where *list* is a
    list of help strings. If the *file* parameter is supplied, then the output of
    the  ``HELP`` command is stored in a file.  If *file* is a string,  then the
-   method will open a file object with that name, write to it  then close it.  If
-   *file* is a file object, then it will start calling :meth:`write` on it to store
+   method will open a file with that name, write to it  then close it.  If *file*
+   is a :term:`file object`, then it will start calling :meth:`write` on it to store
    the lines of the command output. If *file* is supplied, then the returned *list*
    is an empty list.
 
@@ -243,8 +243,8 @@
 
    Send a ``BODY`` command, where *id* has the same meaning as for :meth:`stat`.
    If the *file* parameter is supplied, then the body is stored in a file.  If
-   *file* is a string, then the method will open a file object with that name,
-   write to it then close it. If *file* is a file object, then it will start
+   *file* is a string, then the method will open a file with that name, write
+   to it then close it. If *file* is a :term:`file object`, then it will start
    calling :meth:`write` on it to store the lines of the body. Return as for
    :meth:`head`.  If *file* is supplied, then the returned *list* is an empty list.
 
@@ -270,9 +270,9 @@
    text)``, where *id* is an article number (as a string) and *text* is the text of
    the requested header for that article. If the *file* parameter is supplied, then
    the output of the  ``XHDR`` command is stored in a file.  If *file* is a string,
-   then the method will open a file object with that name, write to it  then close
-   it.  If *file* is a file object, then it will start calling :meth:`write` on it
-   to store the lines of the command output. If *file* is supplied, then the
+   then the method will open a file with that name, write to it  then close it.
+   If *file* is a :term:`file object`, then it will start calling :meth:`write` on
+   it to store the lines of the command output. If *file* is supplied, then the
    returned *list* is an empty list.
 
 
@@ -303,8 +303,8 @@
    Process an ``XGTITLE`` command, returning a pair ``(response, list)``, where
    *list* is a list of tuples containing ``(name, title)``. If the *file* parameter
    is supplied, then the output of the  ``XGTITLE`` command is stored in a file.
-   If *file* is a string,  then the method will open a file object with that name,
-   write to it  then close it.  If *file* is a file object, then it will start
+   If *file* is a string,  then the method will open a file with that name, write
+   to it  then close it.  If *file* is a :term:`file object`, then it will start
    calling :meth:`write` on it to store the lines of the command output. If *file*
    is supplied, then the returned *list* is an empty list. This is an optional NNTP
    extension, and may not be supported by all servers.
@@ -320,8 +320,8 @@
    tuple is of the form ``(article number, subject, poster, date, id, references,
    size, lines)``. If the *file* parameter is supplied, then the output of the
    ``XOVER`` command is stored in a file.  If *file* is a string,  then the method
-   will open a file object with that name, write to it  then close it.  If *file*
-   is a file object, then it will start calling :meth:`write` on it to store the
+   will open a file with that name, write to it  then close it.  If *file* is a
+   :term:`file object`, then it will start calling :meth:`write` on it to store the
    lines of the command output. If *file* is supplied, then the returned *list* is
    an empty list. This is an optional NNTP extension, and may not be supported by
    all servers.

Modified: python/branches/py3k/Doc/library/os.rst
==============================================================================
--- python/branches/py3k/Doc/library/os.rst	(original)
+++ python/branches/py3k/Doc/library/os.rst	Wed Sep 15 13:11:28 2010
@@ -526,7 +526,7 @@
 File Object Creation
 --------------------
 
-These functions create new file objects. (See also :func:`open`.)
+These functions create new :term:`file objects <file object>`. (See also :func:`open`.)
 
 
 .. function:: fdopen(fd[, mode[, bufsize]])
@@ -562,7 +562,7 @@
 by file descriptors.
 
 The :meth:`~file.fileno` method can be used to obtain the file descriptor
-associated with a file object when required.  Note that using the file
+associated with a :term:`file object` when required.  Note that using the file
 descriptor directly will bypass the file object methods, ignoring aspects such
 as internal buffering of data.
 
@@ -679,9 +679,9 @@
    Force write of file with filedescriptor *fd* to disk.  On Unix, this calls the
    native :cfunc:`fsync` function; on Windows, the MS :cfunc:`_commit` function.
 
-   If you're starting with a Python file object *f*, first do ``f.flush()``, and
-   then do ``os.fsync(f.fileno())``, to ensure that all internal buffers associated
-   with *f* are written to disk.
+   If you're starting with a buffered Python :term:`file object` *f*, first do
+   ``f.flush()``, and then do ``os.fsync(f.fileno())``, to ensure that all internal
+   buffers associated with *f* are written to disk.
 
    Availability: Unix, and Windows.
 
@@ -738,9 +738,9 @@
    .. note::
 
       This function is intended for low-level I/O.  For normal usage, use the
-      built-in function :func:`open`, which returns a "file object" with
+      built-in function :func:`open`, which returns a :term:`file object` with
       :meth:`~file.read` and :meth:`~file.write` methods (and many more).  To
-      wrap a file descriptor in a "file object", use :func:`fdopen`.
+      wrap a file descriptor in a file object, use :func:`fdopen`.
 
 
 .. function:: openpty()

Modified: python/branches/py3k/Doc/library/pickle.rst
==============================================================================
--- python/branches/py3k/Doc/library/pickle.rst	(original)
+++ python/branches/py3k/Doc/library/pickle.rst	Wed Sep 15 13:11:28 2010
@@ -143,8 +143,8 @@
 
 .. function:: dump(obj, file, protocol=None, \*, fix_imports=True)
 
-   Write a pickled representation of *obj* to the open file object *file*.  This
-   is equivalent to ``Pickler(file, protocol).dump(obj)``.
+   Write a pickled representation of *obj* to the open :term:`file object` *file*.
+   This is equivalent to ``Pickler(file, protocol).dump(obj)``.
 
    The optional *protocol* argument tells the pickler to use the given protocol;
    supported protocols are 0, 1, 2, 3.  The default protocol is 3; a
@@ -155,8 +155,9 @@
    Python needed to read the pickle produced.
 
    The *file* argument must have a write() method that accepts a single bytes
-   argument.  It can thus be a file object opened for binary writing, a
-   io.BytesIO instance, or any other custom object that meets this interface.
+   argument.  It can thus be an on-disk file opened for binary writing, a
+   :class:`io.BytesIO` instance, or any other custom object that meets this
+   interface.
 
    If *fix_imports* is True and *protocol* is less than 3, pickle will try to
    map the new Python 3.x names to the old module names used in Python 2.x,
@@ -181,8 +182,8 @@
 
 .. function:: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict")
 
-   Read a pickled object representation from the open file object *file* and
-   return the reconstituted object hierarchy specified therein.  This is
+   Read a pickled object representation from the open :term:`file object` *file*
+   and return the reconstituted object hierarchy specified therein.  This is
    equivalent to ``Unpickler(file).load()``.
 
    The protocol version of the pickle is detected automatically, so no protocol
@@ -191,9 +192,9 @@
 
    The argument *file* must have two methods, a read() method that takes an
    integer argument, and a readline() method that requires no arguments.  Both
-   methods should return bytes.  Thus *file* can be a binary file object opened
-   for reading, a BytesIO object, or any other custom object that meets this
-   interface.
+   methods should return bytes.  Thus *file* can be an on-disk file opened
+   for binary reading, a :class:`io.BytesIO` object, or any other custom object
+   that meets this interface.
 
    Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
    which are used to control compatiblity support for pickle stream generated
@@ -260,8 +261,8 @@
    Python needed to read the pickle produced.
 
    The *file* argument must have a write() method that accepts a single bytes
-   argument.  It can thus be a file object opened for binary writing, a
-   io.BytesIO instance, or any other custom object that meets this interface.
+   argument.  It can thus be an on-disk file opened for binary writing, a
+   :class:`io.BytesIO` instance, or any other custom object that meets this interface.
 
    If *fix_imports* is True and *protocol* is less than 3, pickle will try to
    map the new Python 3.x names to the old module names used in Python 2.x,
@@ -304,9 +305,9 @@
 
    The argument *file* must have two methods, a read() method that takes an
    integer argument, and a readline() method that requires no arguments.  Both
-   methods should return bytes.  Thus *file* can be a binary file object opened
-   for reading, a BytesIO object, or any other custom object that meets this
-   interface.
+   methods should return bytes.  Thus *file* can be an on-disk file object opened
+   for binary reading, a :class:`io.BytesIO` object, or any other custom object
+   that meets this interface.
 
    Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
    which are used to control compatiblity support for pickle stream generated

Modified: python/branches/py3k/Doc/library/quopri.rst
==============================================================================
--- python/branches/py3k/Doc/library/quopri.rst	(original)
+++ python/branches/py3k/Doc/library/quopri.rst	Wed Sep 15 13:11:28 2010
@@ -21,25 +21,24 @@
 .. function:: decode(input, output, header=False)
 
    Decode the contents of the *input* file and write the resulting decoded binary
-   data to the *output* file. *input* and *output* must either be file objects or
-   objects that mimic the file object interface. *input* will be read until
-   ``input.readline()`` returns an empty string. If the optional argument *header*
-   is present and true, underscore will be decoded as space. This is used to decode
-   "Q"-encoded headers as described in :rfc:`1522`: "MIME (Multipurpose Internet
-   Mail Extensions) Part Two: Message Header Extensions for Non-ASCII Text".
+   data to the *output* file. *input* and *output* must be :term:`file objects
+   <file object>`.  *input* will be read until ``input.readline()`` returns an
+   empty string. If the optional argument *header* is present and true, underscore
+   will be decoded as space. This is used to decode "Q"-encoded headers as
+   described in :rfc:`1522`: "MIME (Multipurpose Internet Mail Extensions)
+   Part Two: Message Header Extensions for Non-ASCII Text".
 
 
 .. function:: encode(input, output, quotetabs, header=False)
 
    Encode the contents of the *input* file and write the resulting quoted-printable
-   data to the *output* file. *input* and *output* must either be file objects or
-   objects that mimic the file object interface. *input* will be read until
-   ``input.readline()`` returns an empty string. *quotetabs* is a flag which
-   controls whether to encode embedded spaces and tabs; when true it encodes such
-   embedded whitespace, and when false it leaves them unencoded.  Note that spaces
-   and tabs appearing at the end of lines are always encoded, as per
-   :rfc:`1521`.  *header* is a flag which controls if spaces are encoded as
-   underscores as per :rfc:`1522`.
+   data to the *output* file. *input* and *output* must be :term:`file objects
+   <file object>`.  *input* will be read until ``input.readline()`` returns an
+   empty string. *quotetabs* is a flag which controls whether to encode embedded
+   spaces and tabs; when true it encodes such embedded whitespace, and when
+   false it leaves them unencoded.  Note that spaces and tabs appearing at the
+   end of lines are always encoded, as per :rfc:`1521`.  *header* is a flag
+   which controls if spaces are encoded as underscores as per :rfc:`1522`.
 
 
 .. function:: decodestring(s, header=False)

Modified: python/branches/py3k/Doc/library/select.rst
==============================================================================
--- python/branches/py3k/Doc/library/select.rst	(original)
+++ python/branches/py3k/Doc/library/select.rst	Wed Sep 15 13:11:28 2010
@@ -78,11 +78,12 @@
       single: socket() (in module socket)
       single: popen() (in module os)
 
-   Among the acceptable object types in the sequences are Python file objects (e.g.
-   ``sys.stdin``, or objects returned by :func:`open` or :func:`os.popen`), socket
-   objects returned by :func:`socket.socket`.  You may also define a :dfn:`wrapper`
-   class yourself, as long as it has an appropriate :meth:`fileno` method (that
-   really returns a file descriptor, not just a random integer).
+   Among the acceptable object types in the sequences are Python :term:`file
+   objects <file object>` (e.g. ``sys.stdin``, or objects returned by
+   :func:`open` or :func:`os.popen`), socket objects returned by
+   :func:`socket.socket`.  You may also define a :dfn:`wrapper` class yourself,
+   as long as it has an appropriate :meth:`fileno` method (that really returns
+   a file descriptor, not just a random integer).
 
    .. note::
 

Modified: python/branches/py3k/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/stdtypes.rst	(original)
+++ python/branches/py3k/Doc/library/stdtypes.rst	Wed Sep 15 13:11:28 2010
@@ -2441,9 +2441,9 @@
    the identifier in the :keyword:`as` clause of :keyword:`with` statements using
    this context manager.
 
-   An example of a context manager that returns itself is a file object. File
-   objects return themselves from __enter__() to allow :func:`open` to be used as
-   the context expression in a :keyword:`with` statement.
+   An example of a context manager that returns itself is a :term:`file object`.
+   File objects return themselves from __enter__() to allow :func:`open` to be
+   used as the context expression in a :keyword:`with` statement.
 
    An example of a context manager that returns a related object is the one
    returned by :func:`decimal.localcontext`. These managers set the active

Modified: python/branches/py3k/Doc/library/subprocess.rst
==============================================================================
--- python/branches/py3k/Doc/library/subprocess.rst	(original)
+++ python/branches/py3k/Doc/library/subprocess.rst	Wed Sep 15 13:11:28 2010
@@ -108,9 +108,9 @@
    *stdin*, *stdout* and *stderr* specify the executed programs' standard input,
    standard output and standard error file handles, respectively.  Valid values
    are :data:`PIPE`, an existing file descriptor (a positive integer), an
-   existing file object, and ``None``.  :data:`PIPE` indicates that a new pipe
-   to the child should be created.  With ``None``, no redirection will occur;
-   the child's file handles will be inherited from the parent.  Additionally,
+   existing :term:`file object`, and ``None``.  :data:`PIPE` indicates that a
+   new pipe to the child should be created.  With ``None``, no redirection will
+   occur; the child's file handles will be inherited from the parent.  Additionally,
    *stderr* can be :data:`STDOUT`, which indicates that the stderr data from the
    applications should be captured into the same file handle as for stdout.
 
@@ -409,20 +409,20 @@
 
 .. attribute:: Popen.stdin
 
-   If the *stdin* argument was :data:`PIPE`, this attribute is a file object
-   that provides input to the child process.  Otherwise, it is ``None``.
+   If the *stdin* argument was :data:`PIPE`, this attribute is a :term:`file
+   object` that provides input to the child process.  Otherwise, it is ``None``.
 
 
 .. attribute:: Popen.stdout
 
-   If the *stdout* argument was :data:`PIPE`, this attribute is a file object
-   that provides output from the child process.  Otherwise, it is ``None``.
+   If the *stdout* argument was :data:`PIPE`, this attribute is a :term:`file
+   object` that provides output from the child process.  Otherwise, it is ``None``.
 
 
 .. attribute:: Popen.stderr
 
-   If the *stderr* argument was :data:`PIPE`, this attribute is a file object
-   that provides error output from the child process.  Otherwise, it is
+   If the *stderr* argument was :data:`PIPE`, this attribute is a :term:`file
+   object` that provides error output from the child process.  Otherwise, it is
    ``None``.
 
 

Modified: python/branches/py3k/Doc/library/sys.rst
==============================================================================
--- python/branches/py3k/Doc/library/sys.rst	(original)
+++ python/branches/py3k/Doc/library/sys.rst	Wed Sep 15 13:11:28 2010
@@ -853,10 +853,10 @@
           stdout
           stderr
 
-   File objects corresponding to the interpreter's standard input, output and error
-   streams.  ``stdin`` is used for all interpreter input except for scripts but
-   including calls to :func:`input`.  ``stdout`` is used for
-   the output of :func:`print` and :term:`expression` statements and for the
+   :term:`File objects <file object>` corresponding to the interpreter's standard
+   input, output and error streams.  ``stdin`` is used for all interpreter input
+   except for scripts but including calls to :func:`input`.  ``stdout`` is used
+   for the output of :func:`print` and :term:`expression` statements and for the
    prompts of :func:`input`. The interpreter's own prompts
    and (almost all of) its error messages go to ``stderr``.  ``stdout`` and
    ``stderr`` needn't be built-in file objects: any object is acceptable as long

Modified: python/branches/py3k/Doc/library/tarfile.rst
==============================================================================
--- python/branches/py3k/Doc/library/tarfile.rst	(original)
+++ python/branches/py3k/Doc/library/tarfile.rst	Wed Sep 15 13:11:28 2010
@@ -66,8 +66,8 @@
    *mode* ``'r'`` to avoid this.  If a compression method is not supported,
    :exc:`CompressionError` is raised.
 
-   If *fileobj* is specified, it is used as an alternative to a file object opened
-   for *name*. It is supposed to be at position 0.
+   If *fileobj* is specified, it is used as an alternative to a :term:`file object`
+   opened in binary mode for *name*. It is supposed to be at position 0.
 
    For special purposes, there is a second format for *mode*:
    ``'filemode|[compression]'``.  :func:`tarfile.open` will return a :class:`TarFile`
@@ -75,7 +75,7 @@
    be done on the file. If given, *fileobj* may be any object that has a
    :meth:`read` or :meth:`write` method (depending on the *mode*). *bufsize*
    specifies the blocksize and defaults to ``20 * 512`` bytes. Use this variant
-   in combination with e.g. ``sys.stdin``, a socket file object or a tape
+   in combination with e.g. ``sys.stdin``, a socket :term:`file object` or a tape
    device. However, such a :class:`TarFile` object is limited in that it does
    not allow to be accessed randomly, see :ref:`tar-examples`.  The currently
    possible modes:
@@ -355,9 +355,9 @@
 .. method:: TarFile.extractfile(member)
 
    Extract a member from the archive as a file object. *member* may be a filename
-   or a :class:`TarInfo` object. If *member* is a regular file, a file-like object
-   is returned. If *member* is a link, a file-like object is constructed from the
-   link's target. If *member* is none of the above, :const:`None` is returned.
+   or a :class:`TarInfo` object. If *member* is a regular file, a :term:`file-like
+   object` is returned. If *member* is a link, a file-like object is constructed from
+   the link's target. If *member* is none of the above, :const:`None` is returned.
 
    .. note::
 
@@ -402,9 +402,9 @@
 
 .. method:: TarFile.gettarinfo(name=None, arcname=None, fileobj=None)
 
-   Create a :class:`TarInfo` object for either the file *name* or the file object
-   *fileobj* (using :func:`os.fstat` on its file descriptor).  You can modify some
-   of the :class:`TarInfo`'s attributes before you add it using :meth:`addfile`.
+   Create a :class:`TarInfo` object for either the file *name* or the :term:`file
+   object` *fileobj* (using :func:`os.fstat` on its file descriptor).  You can modify
+   some of the :class:`TarInfo`'s attributes before you add it using :meth:`addfile`.
    If given, *arcname* specifies an alternative name for the file in the archive.
 
 

Modified: python/branches/py3k/Doc/library/tempfile.rst
==============================================================================
--- python/branches/py3k/Doc/library/tempfile.rst	(original)
+++ python/branches/py3k/Doc/library/tempfile.rst	Wed Sep 15 13:11:28 2010
@@ -29,7 +29,7 @@
 
 .. function:: TemporaryFile(mode='w+b', buffering=None, encoding=None, newline=None, suffix='', prefix='tmp', dir=None)
 
-   Return a file-like object that can be used as a temporary storage area.
+   Return a :term:`file-like object` that can be used as a temporary storage area.
    The file is created using :func:`mkstemp`. It will be destroyed as soon
    as it is closed (including an implicit close when the object is garbage
    collected).  Under Unix, the directory entry for the file is removed

Modified: python/branches/py3k/Doc/library/termios.rst
==============================================================================
--- python/branches/py3k/Doc/library/termios.rst	(original)
+++ python/branches/py3k/Doc/library/termios.rst	Wed Sep 15 13:11:28 2010
@@ -17,7 +17,7 @@
 
 All functions in this module take a file descriptor *fd* as their first
 argument.  This can be an integer file descriptor, such as returned by
-``sys.stdin.fileno()``, or a file object, such as ``sys.stdin`` itself.
+``sys.stdin.fileno()``, or a :term:`file object`, such as ``sys.stdin`` itself.
 
 This module also defines all the constants needed to work with the functions
 provided here; these have the same name as their counterparts in C.  Please

Modified: python/branches/py3k/Doc/library/weakref.rst
==============================================================================
--- python/branches/py3k/Doc/library/weakref.rst	(original)
+++ python/branches/py3k/Doc/library/weakref.rst	Wed Sep 15 13:11:28 2010
@@ -58,8 +58,9 @@
 
 Not all objects can be weakly referenced; those objects which can include class
 instances, functions written in Python (but not in C), instance methods, sets,
-frozensets, file objects, :term:`generator`\s, type objects, sockets, arrays,
-deques, regular expression pattern objects, and code objects.
+frozensets, some :term:`file objects <file object>`, :term:`generator`\s, type
+objects, sockets, arrays, deques, regular expression pattern objects, and code
+objects.
 
 .. versionchanged:: 3.2
    Added support for thread.lock, threading.Lock, and code objects.

Modified: python/branches/py3k/Doc/library/xml.etree.elementtree.rst
==============================================================================
--- python/branches/py3k/Doc/library/xml.etree.elementtree.rst	(original)
+++ python/branches/py3k/Doc/library/xml.etree.elementtree.rst	Wed Sep 15 13:11:28 2010
@@ -92,8 +92,8 @@
 .. function:: iterparse(source, events=None, parser=None)
 
    Parses an XML section into an element tree incrementally, and reports what's
-   going on to the user.  *source* is a filename or file object containing XML
-   data.  *events* is a list of events to report back.  If omitted, only "end"
+   going on to the user.  *source* is a filename or :term:`file object` containing
+   XML data.  *events* is a list of events to report back.  If omitted, only "end"
    events are reported.  *parser* is an optional parser instance.  If not
    given, the standard :class:`XMLParser` parser is used.  Returns an
    :term:`iterator` providing ``(event, elem)`` pairs.
@@ -455,15 +455,15 @@
    .. method:: parse(source, parser=None)
 
       Loads an external XML section into this element tree.  *source* is a file
-      name or file object.  *parser* is an optional parser instance.  If not
-      given, the standard XMLParser parser is used.  Returns the section
+      name or :term:`file object`.  *parser* is an optional parser instance.
+      If not given, the standard XMLParser parser is used.  Returns the section
       root element.
 
 
    .. method:: write(file, encoding="us-ascii", xml_declaration=None, method="xml")
 
       Writes the element tree to a file, as XML.  *file* is a file name, or a
-      file object opened for writing.  *encoding* [1]_ is the output encoding
+      :term:`file object` opened for writing.  *encoding* [1]_ is the output encoding
       (default is US-ASCII).  Use ``encoding="unicode"`` to write a Unicode string.
       *xml_declaration* controls if an XML declaration
       should be added to the file.  Use False for never, True for always, None

Modified: python/branches/py3k/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/inputoutput.rst	(original)
+++ python/branches/py3k/Doc/tutorial/inputoutput.rst	Wed Sep 15 13:11:28 2010
@@ -232,8 +232,8 @@
    builtin: open
    object: file
 
-:func:`open` returns a file object, and is most commonly used with two
-arguments: ``open(filename, mode)``.
+:func:`open` returns a :term:`file object`, and is most commonly used with
+two arguments: ``open(filename, mode)``.
 
 ::
 


More information about the Python-checkins mailing list