Skip to content

Commit bfdcd43

Browse files
Issue #18758: Fixed and improved cross-references.
1 parent 24201d4 commit bfdcd43

40 files changed

+145
-126
lines changed

Doc/faq/design.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,8 @@ Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base Classes
634634
(ABCs). You can then use :func:`isinstance` and :func:`issubclass` to check
635635
whether an instance or a class implements a particular ABC. The
636636
:mod:`collections.abc` module defines a set of useful ABCs such as
637-
:class:`Iterable`, :class:`Container`, and :class:`MutableMapping`.
637+
:class:`~collections.abc.Iterable`, :class:`~collections.abc.Container`, and
638+
:class:`~collections.abc.MutableMapping`.
638639

639640
For Python, many of the advantages of interface specifications can be obtained
640641
by an appropriate test discipline for components. There is also a tool,

Doc/howto/unicode.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -531,9 +531,10 @@ The solution would be to use the low-level decoding interface to catch the case
531531
of partial coding sequences. The work of implementing this has already been
532532
done for you: the built-in :func:`open` function can return a file-like object
533533
that assumes the file's contents are in a specified encoding and accepts Unicode
534-
parameters for methods such as :meth:`read` and :meth:`write`. This works through
535-
:func:`open`\'s *encoding* and *errors* parameters which are interpreted just
536-
like those in :meth:`str.encode` and :meth:`bytes.decode`.
534+
parameters for methods such as :meth:`~io.TextIOBase.read` and
535+
:meth:`~io.TextIOBase.write`. This works through:func:`open`\'s *encoding* and
536+
*errors* parameters which are interpreted just like those in :meth:`str.encode`
537+
and :meth:`bytes.decode`.
537538

538539
Reading Unicode from a file is therefore simple::
539540

@@ -656,7 +657,8 @@ encodings, taking a stream that returns data in encoding #1
656657
and behaving like a stream returning data in encoding #2.
657658

658659
For example, if you have an input file *f* that's in Latin-1, you
659-
can wrap it with a :class:`StreamRecoder` to return bytes encoded in UTF-8::
660+
can wrap it with a :class:`~codecs.StreamRecoder` to return bytes encoded in
661+
UTF-8::
660662

661663
new_f = codecs.StreamRecoder(f,
662664
# en/decoder: used by read() to encode its results and

Doc/howto/urllib2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The simplest way to use urllib.request is as follows::
5757
html = response.read()
5858

5959
If you wish to retrieve a resource via URL and store it in a temporary location,
60-
you can do so via the :func:`urlretrieve` function::
60+
you can do so via the :func:`~urllib.request.urlretrieve` function::
6161

6262
import urllib.request
6363
local_filename, headers = urllib.request.urlretrieve('http://python.org/')

Doc/library/2to3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ and off individually. They are described here in more detail.
290290
291291
Converts the use of iterator's :meth:`~iterator.next` methods to the
292292
:func:`next` function. It also renames :meth:`next` methods to
293-
:meth:`~object.__next__`.
293+
:meth:`~iterator.__next__`.
294294
295295
.. 2to3fixer:: nonzero
296296
297-
Renames :meth:`~object.__nonzero__` to :meth:`~object.__bool__`.
297+
Renames :meth:`__nonzero__` to :meth:`~object.__bool__`.
298298
299299
.. 2to3fixer:: numliterals
300300

Doc/library/_thread.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ In addition to these methods, lock objects can also be used via the
177177
equivalent to calling :func:`_thread.exit`.
178178

179179
* Not all built-in functions that may block waiting for I/O allow other threads
180-
to run. (The most popular ones (:func:`time.sleep`, :meth:`file.read`,
180+
to run. (The most popular ones (:func:`time.sleep`, :meth:`io.FileIO.read`,
181181
:func:`select.select`) work as expected.)
182182

183183
* It is not possible to interrupt the :meth:`acquire` method on a lock --- the

Doc/library/abc.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,19 +110,19 @@ This module provides the following class:
110110
MyIterable.register(Foo)
111111

112112
The ABC ``MyIterable`` defines the standard iterable method,
113-
:meth:`__iter__`, as an abstract method. The implementation given here can
114-
still be called from subclasses. The :meth:`get_iterator` method is also
115-
part of the ``MyIterable`` abstract base class, but it does not have to be
116-
overridden in non-abstract derived classes.
113+
:meth:`~iterator.__iter__`, as an abstract method. The implementation given
114+
here can still be called from subclasses. The :meth:`get_iterator` method
115+
is also part of the ``MyIterable`` abstract base class, but it does not have
116+
to be overridden in non-abstract derived classes.
117117

118118
The :meth:`__subclasshook__` class method defined here says that any class
119-
that has an :meth:`__iter__` method in its :attr:`__dict__` (or in that of
120-
one of its base classes, accessed via the :attr:`__mro__` list) is
121-
considered a ``MyIterable`` too.
119+
that has an :meth:`~iterator.__iter__` method in its
120+
:attr:`~object.__dict__` (or in that of one of its base classes, accessed
121+
via the :attr:`~class.__mro__` list) is considered a ``MyIterable`` too.
122122

123123
Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``,
124-
even though it does not define an :meth:`__iter__` method (it uses the
125-
old-style iterable protocol, defined in terms of :meth:`__len__` and
124+
even though it does not define an :meth:`~iterator.__iter__` method (it uses
125+
the old-style iterable protocol, defined in terms of :meth:`__len__` and
126126
:meth:`__getitem__`). Note that this will not make ``get_iterator``
127127
available as a method of ``Foo``, so it is provided separately.
128128

Doc/library/asyncore.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ any that have been added to the map during asynchronous service) is closed.
5353
channels have been closed. All arguments are optional. The *count*
5454
parameter defaults to None, resulting in the loop terminating only when all
5555
channels have been closed. The *timeout* argument sets the timeout
56-
parameter for the appropriate :func:`select` or :func:`poll` call, measured
57-
in seconds; the default is 30 seconds. The *use_poll* parameter, if true,
58-
indicates that :func:`poll` should be used in preference to :func:`select`
59-
(the default is ``False``).
56+
parameter for the appropriate :func:`~select.select` or :func:`~select.poll`
57+
call, measured in seconds; the default is 30 seconds. The *use_poll*
58+
parameter, if true, indicates that :func:`~select.poll` should be used in
59+
preference to :func:`~select.select` (the default is ``False``).
6060

6161
The *map* parameter is a dictionary whose items are the channels to watch.
6262
As channels are closed they are deleted from their map. If *map* is

Doc/library/audioop.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ to be stateless (i.e. to be able to tolerate packet loss) you should not only
241241
transmit the data but also the state. Note that you should send the *initial*
242242
state (the one you passed to :func:`lin2adpcm`) along to the decoder, not the
243243
final state (as returned by the coder). If you want to use
244-
:func:`struct.struct` to store the state in binary you can code the first
244+
:class:`struct.Struct` to store the state in binary you can code the first
245245
element (the predicted value) in 16 bits and the second (the delta index) in 8.
246246

247247
The ADPCM coders have never been tried against other ADPCM coders, only against

Doc/library/calendar.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,11 @@ For simple text calendars this module provides the following functions.
272272

273273
.. function:: timegm(tuple)
274274

275-
An unrelated but handy function that takes a time tuple such as returned by the
276-
:func:`gmtime` function in the :mod:`time` module, and returns the corresponding
277-
Unix timestamp value, assuming an epoch of 1970, and the POSIX encoding. In
278-
fact, :func:`time.gmtime` and :func:`timegm` are each others' inverse.
275+
An unrelated but handy function that takes a time tuple such as returned by
276+
the :func:`~time.gmtime` function in the :mod:`time` module, and returns the
277+
corresponding Unix timestamp value, assuming an epoch of 1970, and the POSIX
278+
encoding. In fact, :func:`time.gmtime` and :func:`timegm` are each others'
279+
inverse.
279280

280281

281282
The :mod:`calendar` module exports the following data attributes:

Doc/library/chunk.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ instance will fail with a :exc:`EOFError` exception.
5454

5555
Class which represents a chunk. The *file* argument is expected to be a
5656
file-like object. An instance of this class is specifically allowed. The
57-
only method that is needed is :meth:`read`. If the methods :meth:`seek` and
58-
:meth:`tell` are present and don't raise an exception, they are also used.
57+
only method that is needed is :meth:`~io.IOBase.read`. If the methods
58+
:meth:`~io.IOBase.seek` and :meth:`~io.IOBase.tell` are present and don't
59+
raise an exception, they are also used.
5960
If these methods are present and raise an exception, they are expected to not
6061
have altered the object. If the optional argument *align* is true, chunks
6162
are assumed to be aligned on 2-byte boundaries. If *align* is false, no

0 commit comments

Comments
 (0)