mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Improve references in the tutorial (GH-108069)
* Use full qualified names for references (even if they do not work now, they will work in future). * Silence references to examples.
This commit is contained in:
parent
20cc90c0df
commit
622ddc4167
6 changed files with 48 additions and 49 deletions
|
@ -15,7 +15,7 @@ Fancier Output Formatting
|
|||
=========================
|
||||
|
||||
So far we've encountered two ways of writing values: *expression statements* and
|
||||
the :func:`print` function. (A third way is using the :meth:`write` method
|
||||
the :func:`print` function. (A third way is using the :meth:`~io.TextIOBase.write` method
|
||||
of file objects; the standard output file can be referenced as ``sys.stdout``.
|
||||
See the Library Reference for more information on this.)
|
||||
|
||||
|
@ -456,8 +456,8 @@ to the very file end with ``seek(0, 2)``) and the only valid *offset* values are
|
|||
those returned from the ``f.tell()``, or zero. Any other *offset* value produces
|
||||
undefined behaviour.
|
||||
|
||||
File objects have some additional methods, such as :meth:`~file.isatty` and
|
||||
:meth:`~file.truncate` which are less frequently used; consult the Library
|
||||
File objects have some additional methods, such as :meth:`~io.IOBase.isatty` and
|
||||
:meth:`~io.IOBase.truncate` which are less frequently used; consult the Library
|
||||
Reference for a complete guide to file objects.
|
||||
|
||||
|
||||
|
@ -469,7 +469,7 @@ Saving structured data with :mod:`json`
|
|||
.. index:: pair: module; json
|
||||
|
||||
Strings can easily be written to and read from a file. Numbers take a bit more
|
||||
effort, since the :meth:`read` method only returns strings, which will have to
|
||||
effort, since the :meth:`~io.TextIOBase.read` method only returns strings, which will have to
|
||||
be passed to a function like :func:`int`, which takes a string like ``'123'``
|
||||
and returns its numeric value 123. When you want to save more complex data
|
||||
types like nested lists and dictionaries, parsing and serializing by hand
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue