Kaydet (Commit) 6d5bd525 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #18743: Improved cross-references to the StringIO class.

üst 7653e26e
...@@ -199,7 +199,7 @@ type objects) *must* have the :attr:`ob_size` field. ...@@ -199,7 +199,7 @@ type objects) *must* have the :attr:`ob_size` field.
An optional pointer to the instance print function. An optional pointer to the instance print function.
The print function is only called when the instance is printed to a *real* file; The print function is only called when the instance is printed to a *real* file;
when it is printed to a pseudo-file (like a :class:`StringIO` instance), the when it is printed to a pseudo-file (like a :class:`~StringIO.StringIO` instance), the
instance's :c:member:`~PyTypeObject.tp_repr` or :c:member:`~PyTypeObject.tp_str` function is called to convert it to instance's :c:member:`~PyTypeObject.tp_repr` or :c:member:`~PyTypeObject.tp_str` function is called to convert it to
a string. These are also called when the type's :c:member:`~PyTypeObject.tp_print` field is a string. These are also called when the type's :c:member:`~PyTypeObject.tp_print` field is
*NULL*. A type should never implement :c:member:`~PyTypeObject.tp_print` in a way that produces *NULL*. A type should never implement :c:member:`~PyTypeObject.tp_print` in a way that produces
......
...@@ -33,7 +33,7 @@ The module defines the following items: ...@@ -33,7 +33,7 @@ The module defines the following items:
given a non-trivial value. given a non-trivial value.
The new class instance is based on *fileobj*, which can be a regular file, a The new class instance is based on *fileobj*, which can be a regular file, a
:class:`StringIO` object, or any other object which simulates a file. It :class:`~StringIO.StringIO` object, or any other object which simulates a file. It
defaults to ``None``, in which case *filename* is opened to provide a file defaults to ``None``, in which case *filename* is opened to provide a file
object. object.
...@@ -65,9 +65,9 @@ The module defines the following items: ...@@ -65,9 +65,9 @@ The module defines the following items:
Calling a :class:`GzipFile` object's :meth:`close` method does not close Calling a :class:`GzipFile` object's :meth:`close` method does not close
*fileobj*, since you might wish to append more material after the compressed *fileobj*, since you might wish to append more material after the compressed
data. This also allows you to pass a :class:`StringIO` object opened for data. This also allows you to pass a :class:`~StringIO.StringIO` object opened for
writing as *fileobj*, and retrieve the resulting memory buffer using the writing as *fileobj*, and retrieve the resulting memory buffer using the
:class:`StringIO` object's :meth:`getvalue` method. :class:`StringIO` object's :meth:`~StringIO.StringIO.getvalue` method.
:class:`GzipFile` supports iteration and the :keyword:`with` statement. :class:`GzipFile` supports iteration and the :keyword:`with` statement.
......
...@@ -661,7 +661,7 @@ Maildir, mbox, MH, Babyl, and MMDF. ...@@ -661,7 +661,7 @@ Maildir, mbox, MH, Babyl, and MMDF.
In Babyl mailboxes, the headers of a message are not stored contiguously In Babyl mailboxes, the headers of a message are not stored contiguously
with the body of the message. To generate a file-like representation, the with the body of the message. To generate a file-like representation, the
headers and body are copied together into a :class:`StringIO` instance headers and body are copied together into a :class:`~StringIO.StringIO` instance
(from the :mod:`StringIO` module), which has an API identical to that of a (from the :mod:`StringIO` module), which has an API identical to that of a
file. As a result, the file-like object is truly independent of the file. As a result, the file-like object is truly independent of the
underlying mailbox but does not save memory compared to a string underlying mailbox but does not save memory compared to a string
......
...@@ -24,7 +24,7 @@ to rearrange their order. ...@@ -24,7 +24,7 @@ to rearrange their order.
Return a new instance of the :class:`MimeWriter` class. The only argument Return a new instance of the :class:`MimeWriter` class. The only argument
passed, *fp*, is a file object to be used for writing. Note that a passed, *fp*, is a file object to be used for writing. Note that a
:class:`StringIO` object could also be used. :class:`~StringIO.StringIO` object could also be used.
.. _mimewriter-objects: .. _mimewriter-objects:
......
...@@ -93,7 +93,7 @@ The module defines the following user-callable functions: ...@@ -93,7 +93,7 @@ The module defines the following user-callable functions:
causes the file to roll over to an on-disk file regardless of its size. causes the file to roll over to an on-disk file regardless of its size.
The returned object is a file-like object whose :attr:`_file` attribute The returned object is a file-like object whose :attr:`_file` attribute
is either a :class:`StringIO` object or a true file object, depending on is either a :class:`~StringIO.StringIO` object or a true file object, depending on
whether :func:`rollover` has been called. This file-like object can be whether :func:`rollover` has been called. This file-like object can be
used in a :keyword:`with` statement, just like a normal file. used in a :keyword:`with` statement, just like a normal file.
......
...@@ -58,7 +58,7 @@ instead: ...@@ -58,7 +58,7 @@ instead:
.. function:: parseString(string[, parser]) .. function:: parseString(string[, parser])
Return a :class:`Document` that represents the *string*. This method creates a Return a :class:`Document` that represents the *string*. This method creates a
:class:`io.StringIO` object for the string and passes that on to :func:`parse`. :class:`~StringIO.StringIO` object for the string and passes that on to :func:`parse`.
Both functions return a :class:`Document` object representing the content of the Both functions return a :class:`Document` object representing the content of the
document. document.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment