Skip to content

Commit f5147c0

Browse files
authored
gh-101100: Fix some broken sphinx references (#107095)
1 parent dcd7acb commit f5147c0

12 files changed

+27
-34
lines changed

Doc/c-api/iterator.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Iterator Objects
66
----------------
77

88
Python provides two general-purpose iterator objects. The first, a sequence
9-
iterator, works with an arbitrary sequence supporting the :meth:`__getitem__`
9+
iterator, works with an arbitrary sequence supporting the :meth:`~object.__getitem__`
1010
method. The second works with a callable object and a sentinel value, calling
1111
the callable for each item in the sequence, and ending the iteration when the
1212
sentinel value is returned.

Doc/c-api/mapping.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
1313
1414
Return ``1`` if the object provides the mapping protocol or supports slicing,
1515
and ``0`` otherwise. Note that it returns ``1`` for Python classes with
16-
a :meth:`__getitem__` method, since in general it is impossible to
16+
a :meth:`~object.__getitem__` method, since in general it is impossible to
1717
determine what type of keys the class supports. This function always succeeds.
1818
1919
@@ -90,7 +90,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
9090
This is equivalent to the Python expression ``key in o``.
9191
This function always succeeds.
9292
93-
Note that exceptions which occur while calling the :meth:`__getitem__`
93+
Note that exceptions which occur while calling the :meth:`~object.__getitem__`
9494
method will get suppressed.
9595
To get error reporting use :c:func:`PyObject_GetItem()` instead.
9696
@@ -101,7 +101,7 @@ See also :c:func:`PyObject_GetItem`, :c:func:`PyObject_SetItem` and
101101
This is equivalent to the Python expression ``key in o``.
102102
This function always succeeds.
103103
104-
Note that exceptions which occur while calling the :meth:`__getitem__`
104+
Note that exceptions which occur while calling the :meth:`~object.__getitem__`
105105
method and creating a temporary string object will get suppressed.
106106
To get error reporting use :c:func:`PyMapping_GetItemString()` instead.
107107

Doc/c-api/refcounting.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ of Python objects.
101101
.. warning::
102102
103103
The deallocation function can cause arbitrary Python code to be invoked (e.g.
104-
when a class instance with a :meth:`__del__` method is deallocated). While
104+
when a class instance with a :meth:`~object.__del__` method is deallocated). While
105105
exceptions in such code are not propagated, the executed code has free access to
106106
all Python global variables. This means that any object that is reachable from
107107
a global variable should be in a consistent state before :c:func:`Py_DECREF` is

Doc/c-api/sequence.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Sequence Protocol
99
.. c:function:: int PySequence_Check(PyObject *o)
1010
1111
Return ``1`` if the object provides the sequence protocol, and ``0`` otherwise.
12-
Note that it returns ``1`` for Python classes with a :meth:`__getitem__`
12+
Note that it returns ``1`` for Python classes with a :meth:`~object.__getitem__`
1313
method, unless they are :class:`dict` subclasses, since in general it
1414
is impossible to determine what type of keys the class supports. This
1515
function always succeeds.

Doc/howto/functional.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,8 @@ write the obvious :keyword:`for` loop::
10721072

10731073
A related function is :func:`itertools.accumulate(iterable, func=operator.add)
10741074
<itertools.accumulate>`. It performs the same calculation, but instead of
1075-
returning only the final result, :func:`accumulate` returns an iterator that
1076-
also yields each partial result::
1075+
returning only the final result, :func:`~itertools.accumulate` returns an iterator
1076+
that also yields each partial result::
10771077

10781078
itertools.accumulate([1, 2, 3, 4, 5]) =>
10791079
1, 3, 6, 10, 15

Doc/howto/regex.rst

+2
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,8 @@ cache.
518518
Compilation Flags
519519
-----------------
520520

521+
.. currentmodule:: re
522+
521523
Compilation flags let you modify some aspects of how regular expressions work.
522524
Flags are available in the :mod:`re` module under two names, a long name such as
523525
:const:`IGNORECASE` and a short, one-letter form such as :const:`I`. (If you're

Doc/howto/sorting.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -273,16 +273,16 @@ Odds and Ends
273273

274274
* The sort routines use ``<`` when making comparisons
275275
between two objects. So, it is easy to add a standard sort order to a class by
276-
defining an :meth:`__lt__` method:
276+
defining an :meth:`~object.__lt__` method:
277277

278278
.. doctest::
279279

280280
>>> Student.__lt__ = lambda self, other: self.age < other.age
281281
>>> sorted(student_objects)
282282
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]
283283

284-
However, note that ``<`` can fall back to using :meth:`__gt__` if
285-
:meth:`__lt__` is not implemented (see :func:`object.__lt__`).
284+
However, note that ``<`` can fall back to using :meth:`~object.__gt__` if
285+
:meth:`~object.__lt__` is not implemented (see :func:`object.__lt__`).
286286

287287
* Key functions need not depend directly on the objects being sorted. A key
288288
function can also access external resources. For instance, if the student grades

Doc/howto/unicode.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,8 @@ lowercase letters 'ss'.
424424

425425
A second tool is the :mod:`unicodedata` module's
426426
:func:`~unicodedata.normalize` function that converts strings to one
427-
of several normal forms, where letters followed by a combining
428-
character are replaced with single characters. :func:`normalize` can
427+
of several normal forms, where letters followed by a combining character are
428+
replaced with single characters. :func:`~unicodedata.normalize` can
429429
be used to perform string comparisons that won't falsely report
430430
inequality if two strings use combining characters differently:
431431

@@ -474,8 +474,8 @@ The Unicode Standard also specifies how to do caseless comparisons::
474474

475475
print(compare_caseless(single_char, multiple_chars))
476476

477-
This will print ``True``. (Why is :func:`NFD` invoked twice? Because
478-
there are a few characters that make :meth:`casefold` return a
477+
This will print ``True``. (Why is :func:`!NFD` invoked twice? Because
478+
there are a few characters that make :meth:`~str.casefold` return a
479479
non-normalized string, so the result needs to be normalized again. See
480480
section 3.13 of the Unicode Standard for a discussion and an example.)
481481

Doc/library/_thread.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ This module defines the following constants and functions:
150150
.. data:: TIMEOUT_MAX
151151

152152
The maximum value allowed for the *timeout* parameter of
153-
:meth:`Lock.acquire`. Specifying a timeout greater than this value will
154-
raise an :exc:`OverflowError`.
153+
:meth:`Lock.acquire <threading.Lock.acquire>`. Specifying a timeout greater
154+
than this value will raise an :exc:`OverflowError`.
155155

156156
.. versionadded:: 3.2
157157

@@ -217,8 +217,9 @@ In addition to these methods, lock objects can also be used via the
217217
* Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is
218218
equivalent to calling :func:`_thread.exit`.
219219

220-
* It is not possible to interrupt the :meth:`acquire` method on a lock --- the
221-
:exc:`KeyboardInterrupt` exception will happen after the lock has been acquired.
220+
* It is not possible to interrupt the :meth:`~threading.Lock.acquire` method on
221+
a lock --- the :exc:`KeyboardInterrupt` exception will happen after the lock
222+
has been acquired.
222223

223224
* When the main thread exits, it is system defined whether the other threads
224225
survive. On most systems, they are killed without executing

Doc/library/codeop.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ To do just the former:
5858

5959
.. class:: Compile()
6060

61-
Instances of this class have :meth:`__call__` methods identical in signature to
61+
Instances of this class have :meth:`~object.__call__` methods identical in signature to
6262
the built-in function :func:`compile`, but with the difference that if the
6363
instance compiles program text containing a :mod:`__future__` statement, the
6464
instance 'remembers' and compiles all subsequent program texts with the
@@ -67,7 +67,7 @@ To do just the former:
6767

6868
.. class:: CommandCompiler()
6969

70-
Instances of this class have :meth:`__call__` methods identical in signature to
70+
Instances of this class have :meth:`~object.__call__` methods identical in signature to
7171
:func:`compile_command`; the difference is that if the instance compiles program
7272
text containing a :mod:`__future__` statement, the instance 'remembers' and
7373
compiles all subsequent program texts with the statement in force.

Doc/library/constants.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ A small number of constants live in the built-in namespace. They are:
2222
An object frequently used to represent the absence of a value, as when
2323
default arguments are not passed to a function. Assignments to ``None``
2424
are illegal and raise a :exc:`SyntaxError`.
25-
``None`` is the sole instance of the :data:`NoneType` type.
25+
``None`` is the sole instance of the :data:`~types.NoneType` type.
2626

2727

2828
.. data:: NotImplemented
2929

3030
A special value which should be returned by the binary special methods
31-
(e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`,
31+
(e.g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :meth:`~object.__rsub__`,
3232
etc.) to indicate that the operation is not implemented with respect to
3333
the other type; may be returned by the in-place binary special methods
34-
(e.g. :meth:`__imul__`, :meth:`__iand__`, etc.) for the same purpose.
34+
(e.g. :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) for the same purpose.
3535
It should not be evaluated in a boolean context.
3636
``NotImplemented`` is the sole instance of the :data:`types.NotImplementedType` type.
3737

Doc/tools/.nitignore

-10
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,12 @@ Doc/c-api/init_config.rst
2727
Doc/c-api/intro.rst
2828
Doc/c-api/iterator.rst
2929
Doc/c-api/long.rst
30-
Doc/c-api/mapping.rst
3130
Doc/c-api/marshal.rst
3231
Doc/c-api/memory.rst
3332
Doc/c-api/memoryview.rst
3433
Doc/c-api/module.rst
3534
Doc/c-api/none.rst
3635
Doc/c-api/object.rst
37-
Doc/c-api/refcounting.rst
38-
Doc/c-api/sequence.rst
3936
Doc/c-api/set.rst
4037
Doc/c-api/stable.rst
4138
Doc/c-api/structures.rst
@@ -59,18 +56,13 @@ Doc/glossary.rst
5956
Doc/howto/curses.rst
6057
Doc/howto/descriptor.rst
6158
Doc/howto/enum.rst
62-
Doc/howto/functional.rst
6359
Doc/howto/instrumentation.rst
6460
Doc/howto/isolating-extensions.rst
6561
Doc/howto/logging-cookbook.rst
6662
Doc/howto/logging.rst
67-
Doc/howto/regex.rst
68-
Doc/howto/sorting.rst
69-
Doc/howto/unicode.rst
7063
Doc/howto/urllib2.rst
7164
Doc/install/index.rst
7265
Doc/library/__future__.rst
73-
Doc/library/_thread.rst
7466
Doc/library/abc.rst
7567
Doc/library/ast.rst
7668
Doc/library/asyncio-dev.rst
@@ -88,13 +80,11 @@ Doc/library/calendar.rst
8880
Doc/library/cmd.rst
8981
Doc/library/code.rst
9082
Doc/library/codecs.rst
91-
Doc/library/codeop.rst
9283
Doc/library/collections.abc.rst
9384
Doc/library/collections.rst
9485
Doc/library/concurrent.futures.rst
9586
Doc/library/concurrent.rst
9687
Doc/library/configparser.rst
97-
Doc/library/constants.rst
9888
Doc/library/contextlib.rst
9989
Doc/library/copy.rst
10090
Doc/library/csv.rst

0 commit comments

Comments
 (0)