[Python-checkins] r77300 - in python/branches/py3k/Doc: library/filesys.rst library/socket.rst library/tokenize.rst reference/datamodel.rst using/cmdline.rst

antoine.pitrou python-checkins at python.org
Mon Jan 4 19:50:53 CET 2010


Author: antoine.pitrou
Date: Mon Jan  4 19:50:53 2010
New Revision: 77300

Log:
Issue #7631: Fix undefined references to the "built-in file object", which
has ceased to be.



Modified:
   python/branches/py3k/Doc/library/filesys.rst
   python/branches/py3k/Doc/library/socket.rst
   python/branches/py3k/Doc/library/tokenize.rst
   python/branches/py3k/Doc/reference/datamodel.rst
   python/branches/py3k/Doc/using/cmdline.rst

Modified: python/branches/py3k/Doc/library/filesys.rst
==============================================================================
--- python/branches/py3k/Doc/library/filesys.rst	(original)
+++ python/branches/py3k/Doc/library/filesys.rst	Mon Jan  4 19:50:53 2010
@@ -26,14 +26,13 @@
 
 .. seealso::
 
-   Section :ref:`bltin-file-objects`
-      A description of Python's built-in file objects.
-
    Module :mod:`os`
       Operating system interfaces, including functions to work with files at a lower
       level than the built-in file object.
 
    Module :mod:`io`
-      Python's framework for dealing with I/O including reading and writing
-      files.
+      Python's built-in I/O library, including both abstract classes and
+      some concrete classes such as file I/O.
 
+   Built-in function :func:`open`
+      The standard way to open files for reading and writing with Python.

Modified: python/branches/py3k/Doc/library/socket.rst
==============================================================================
--- python/branches/py3k/Doc/library/socket.rst	(original)
+++ python/branches/py3k/Doc/library/socket.rst	Mon Jan  4 19:50:53 2010
@@ -575,14 +575,16 @@
 
    .. index:: single: I/O control; buffering
 
-   Return a :dfn:`file object` associated with the socket.  (File objects are
-   described in :ref:`bltin-file-objects`.)  The file object references a
-   :cfunc:`dup`\ ped version of the socket file descriptor, so the file object
-   and socket object may be closed or garbage-collected independently.  The
-   socket must be in blocking mode (it can not have a timeout).  The optional
+   Return a :dfn:`file object` associated with the socket.  The exact
+   returned type depends on the arguments given to :meth:`makefile`.  These
    arguments are interpreted the same way as by the built-in :func:`open`
    function.
 
+   The returned file object references a :cfunc:`dup`\ ped version of the
+   socket file descriptor, so the file object and socket object may be
+   closed or garbage-collected independently.  The socket must be in
+   blocking mode (it can not have a timeout).
+
 
 .. method:: socket.recv(bufsize[, flags])
 

Modified: python/branches/py3k/Doc/library/tokenize.rst
==============================================================================
--- python/branches/py3k/Doc/library/tokenize.rst	(original)
+++ python/branches/py3k/Doc/library/tokenize.rst	Mon Jan  4 19:50:53 2010
@@ -18,9 +18,8 @@
 
    The :func:`tokenize` generator requires one argument, *readline*, which
    must be a callable object which provides the same interface as the
-   :meth:`readline` method of built-in file objects (see section
-   :ref:`bltin-file-objects`).  Each call to the function should return one
-   line of input as bytes.
+   :meth:`io.IOBase.readline` method of file objects.  Each call to the
+   function should return one line of input as bytes.
 
    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple ``(srow, scol)`` of ints specifying the row and

Modified: python/branches/py3k/Doc/reference/datamodel.rst
==============================================================================
--- python/branches/py3k/Doc/reference/datamodel.rst	(original)
+++ python/branches/py3k/Doc/reference/datamodel.rst	Mon Jan  4 19:50:53 2010
@@ -767,10 +767,10 @@
    Special attributes: :attr:`__dict__` is the attribute dictionary;
    :attr:`__class__` is the instance's class.
 
-Files
+I/O objects (also known as file objects)
    .. index::
-      object: file
       builtin: open
+      module: io
       single: popen() (in module os)
       single: makefile() (socket method)
       single: sys.stdin
@@ -781,14 +781,17 @@
       single: stdout (in module sys)
       single: stderr (in module sys)
 
-   A file object represents an open file.  File objects are created by the
-   :func:`open` built-in function, and also by :func:`os.popen`,
-   :func:`os.fdopen`, and the :meth:`makefile` method of socket objects (and
-   perhaps by other functions or methods provided by extension modules).  The
-   objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized to
-   file objects corresponding to the interpreter's standard input, output and
-   error streams.  See :ref:`bltin-file-objects` for complete documentation of
-   file objects.
+   A file object represents an open file.  Various shortcuts are available
+   to create file objects: the :func:`open` built-in function, and also
+   :func:`os.popen`, :func:`os.fdopen`, and the :meth:`makefile` method
+   of socket objects (and perhaps by other functions or methods provided
+   by extension modules).
+
+   The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are
+   initialized to file objects corresponding to the interpreter's standard
+   input, output and error streams; they are all open in text mode and
+   therefore follow the interface defined by the :class:`io.TextIOBase`
+   abstract class.
 
 Internal types
    .. index::

Modified: python/branches/py3k/Doc/using/cmdline.rst
==============================================================================
--- python/branches/py3k/Doc/using/cmdline.rst	(original)
+++ python/branches/py3k/Doc/using/cmdline.rst	Mon Jan  4 19:50:53 2010
@@ -235,11 +235,6 @@
    Force stdin, stdout and stderr to be totally unbuffered.  On systems where it
    matters, also put stdin, stdout and stderr in binary mode.
 
-   Note that there is internal buffering in :meth:`file.readlines` and
-   :ref:`bltin-file-objects` (``for line in sys.stdin``) which is not influenced
-   by this option.  To work around this, you will want to use
-   :meth:`file.readline` inside a ``while 1:`` loop.
-
    See also :envvar:`PYTHONUNBUFFERED`.
 
 


More information about the Python-checkins mailing list