Skip to content

Commit 50d2613

Browse files
[3.11] gh-107298: Fix doc references to undocumented modules (GH-107300) (GH-107371)
(cherry picked from commit 87b3902) Co-authored-by: Victor Stinner <[email protected]>
1 parent 8492aae commit 50d2613

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

Doc/c-api/arg.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ API Functions
506506
will be set if there was a failure.
507507
508508
This is an example of the use of this function, taken from the sources for the
509-
:mod:`_weakref` helper module for weak references::
509+
:mod:`!_weakref` helper module for weak references::
510510
511511
static PyObject *
512512
weakref_ref(PyObject *self, PyObject *args)

Doc/c-api/codec.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Codec registry and support functions
77
88
Register a new codec search function.
99
10-
As side effect, this tries to load the :mod:`encodings` package, if not yet
10+
As side effect, this tries to load the :mod:`!encodings` package, if not yet
1111
done, to make sure that it is always first in the list of search functions.
1212
1313
.. c:function:: int PyCodec_Unregister(PyObject *search_function)

Doc/c-api/typeobj.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
577577
name, followed by a dot, followed by the type name; for built-in types, it
578578
should be just the type name. If the module is a submodule of a package, the
579579
full package name is part of the full module name. For example, a type named
580-
:class:`T` defined in module :mod:`M` in subpackage :mod:`Q` in package :mod:`P`
580+
:class:`T` defined in module :mod:`!M` in subpackage :mod:`!Q` in package :mod:`!P`
581581
should have the :c:member:`~PyTypeObject.tp_name` initializer ``"P.Q.M.T"``.
582582

583583
For :ref:`dynamically allocated type objects <heap-types>`,

Doc/c-api/unicode.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ Character Map Codecs
13041304
13051305
This codec is special in that it can be used to implement many different codecs
13061306
(and this is in fact what was done to obtain most of the standard codecs
1307-
included in the :mod:`encodings` package). The codec uses mappings to encode and
1307+
included in the :mod:`!encodings` package). The codec uses mappings to encode and
13081308
decode characters. The mapping objects provided must support the
13091309
:meth:`__getitem__` mapping interface; dictionaries and sequences work well.
13101310

Doc/extending/extending.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return type,
367367
declares any special linkage declarations required by the platform, and for C++
368368
declares the function as ``extern "C"``.
369369

370-
When the Python program imports module :mod:`spam` for the first time,
370+
When the Python program imports module :mod:`!spam` for the first time,
371371
:c:func:`PyInit_spam` is called. (See below for comments about embedding Python.)
372372
It calls :c:func:`PyModule_Create`, which returns a module object, and
373373
inserts built-in function objects into the newly created module based upon the
@@ -1208,7 +1208,7 @@ file corresponding to the module provides a macro that takes care of importing
12081208
the module and retrieving its C API pointers; client modules only have to call
12091209
this macro before accessing the C API.
12101210

1211-
The exporting module is a modification of the :mod:`spam` module from section
1211+
The exporting module is a modification of the :mod:`!spam` module from section
12121212
:ref:`extending-simpleexample`. The function :func:`spam.system` does not call
12131213
the C library function :c:func:`system` directly, but a function
12141214
:c:func:`PySpam_System`, which would of course do something more complicated in

Doc/extending/newtypes_tutorial.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ object.
3737

3838
This sort of thing can only be explained by example, so here's a minimal, but
3939
complete, module that defines a new type named :class:`Custom` inside a C
40-
extension module :mod:`custom`:
40+
extension module :mod:`!custom`:
4141

4242
.. note::
4343
What we're showing here is the traditional way of defining *static*
@@ -55,7 +55,7 @@ from the previous chapter. This file defines three things:
5555
#. How the :class:`Custom` **type** behaves: this is the ``CustomType`` struct,
5656
which defines a set of flags and function pointers that the interpreter
5757
inspects when specific operations are requested.
58-
#. How to initialize the :mod:`custom` module: this is the ``PyInit_custom``
58+
#. How to initialize the :mod:`!custom` module: this is the ``PyInit_custom``
5959
function and the associated ``custommodule`` struct.
6060

6161
The first bit is::
@@ -127,7 +127,7 @@ our objects and in some error messages, for example:
127127
TypeError: can only concatenate str (not "custom.Custom") to str
128128
129129
Note that the name is a dotted name that includes both the module name and the
130-
name of the type within the module. The module in this case is :mod:`custom` and
130+
name of the type within the module. The module in this case is :mod:`!custom` and
131131
the type is :class:`Custom`, so we set the type name to :class:`custom.Custom`.
132132
Using the real dotted import path is important to make your type compatible
133133
with the :mod:`pydoc` and :mod:`pickle` modules. ::
@@ -231,7 +231,7 @@ Adding data and methods to the Basic example
231231
============================================
232232

233233
Let's extend the basic example to add some data and methods. Let's also make
234-
the type usable as a base class. We'll create a new module, :mod:`custom2` that
234+
the type usable as a base class. We'll create a new module, :mod:`!custom2` that
235235
adds these capabilities:
236236

237237
.. literalinclude:: ../includes/custom2.c

Doc/install/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ will expand this to your home directory::
370370

371371
To make Python find the distributions installed with this scheme, you may have
372372
to :ref:`modify Python's search path <inst-search-path>` or edit
373-
:mod:`sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit
373+
:mod:`!sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit
374374
:data:`sys.path`.
375375

376376
The :option:`!--home` option defines the installation base directory. Files are

0 commit comments

Comments
 (0)