Skip to content

Commit cfa9f3b

Browse files
[3.11] gh-107091: Fix some uses of :c:member: role (GH-107129) (GH-107311)
(cherry picked from commit af61cb9)
1 parent bd0def0 commit cfa9f3b

File tree

7 files changed

+13
-11
lines changed

7 files changed

+13
-11
lines changed

Doc/c-api/import.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Importing Modules
138138
:class:`SourceFileLoader` otherwise.
139139
140140
The module's :attr:`__file__` attribute will be set to the code object's
141-
:c:member:`co_filename`. If applicable, :attr:`__cached__` will also
141+
:attr:`co_filename`. If applicable, :attr:`__cached__` will also
142142
be set.
143143
144144
This function will reload the module if it was already imported. See

Doc/c-api/init_config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ PyConfig
522522
Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv`
523523
is used, this method must be called before other methods, since the
524524
preinitialization configuration depends on command line arguments (if
525-
:c:member:`parse_argv` is non-zero).
525+
:c:member:`~PyConfig.parse_argv` is non-zero).
526526
527527
The caller of these methods is responsible to handle exceptions (error or
528528
exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``.

Doc/c-api/module.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
164164
165165
This memory area is allocated based on *m_size* on module creation,
166166
and freed when the module object is deallocated, after the
167-
:c:member:`m_free` function has been called, if present.
167+
:c:member:`~PyModuleDef.m_free` function has been called, if present.
168168
169169
Setting ``m_size`` to ``-1`` means that the module does not support
170170
sub-interpreters, because it has global state.
@@ -202,7 +202,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
202202
This function is not called if the module state was requested but is not
203203
allocated yet. This is the case immediately after the module is created
204204
and before the module is executed (:c:data:`Py_mod_exec` function). More
205-
precisely, this function is not called if :c:member:`m_size` is greater
205+
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
206206
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
207207
is ``NULL``.
208208
@@ -217,7 +217,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
217217
This function is not called if the module state was requested but is not
218218
allocated yet. This is the case immediately after the module is created
219219
and before the module is executed (:c:data:`Py_mod_exec` function). More
220-
precisely, this function is not called if :c:member:`m_size` is greater
220+
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
221221
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
222222
is ``NULL``.
223223
@@ -238,7 +238,7 @@ or request "multi-phase initialization" by returning the definition struct itsel
238238
This function is not called if the module state was requested but is not
239239
allocated yet. This is the case immediately after the module is created
240240
and before the module is executed (:c:data:`Py_mod_exec` function). More
241-
precisely, this function is not called if :c:member:`m_size` is greater
241+
precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is greater
242242
than 0 and the module state (as returned by :c:func:`PyModule_GetState`)
243243
is ``NULL``.
244244

Doc/c-api/structures.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,16 @@ Implementing functions and methods
263263
264264
points to the contents of the docstring
265265
266-
The :c:member:`ml_meth` is a C function pointer. The functions may be of different
266+
The :c:member:`~PyMethodDef.ml_meth` is a C function pointer.
267+
The functions may be of different
267268
types, but they always return :c:expr:`PyObject*`. If the function is not of
268269
the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
269270
Even though :c:type:`PyCFunction` defines the first parameter as
270271
:c:expr:`PyObject*`, it is common that the method implementation uses the
271272
specific C type of the *self* object.
272273
273-
The :c:member:`ml_flags` field is a bitfield which can include the following flags.
274+
The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include
275+
the following flags.
274276
The individual flags indicate either a calling convention or a binding
275277
convention.
276278

Doc/howto/isolating-extensions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ Module State Access from Slot Methods, Getters and Setters
467467
468468
Slot methods—the fast C equivalents for special methods, such as
469469
:c:member:`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or
470-
:c:member:`~PyType.tp_new` for initialization—have a very simple API that
470+
:c:member:`~PyTypeObject.tp_new` for initialization—have a very simple API that
471471
doesn't allow passing in the defining class, unlike with :c:type:`PyCMethod`.
472472
The same goes for getters and setters defined with
473473
:c:type:`PyGetSetDef`.

Doc/whatsnew/3.5.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,7 @@ Changes in the C API
25332533

25342534
* As part of the :pep:`492` implementation, the ``tp_reserved`` slot of
25352535
:c:type:`PyTypeObject` was replaced with a
2536-
:c:member:`tp_as_async` slot. Refer to :ref:`coro-objects` for
2536+
:c:member:`~PyTypeObject.tp_as_async` slot. Refer to :ref:`coro-objects` for
25372537
new types, structures and functions.
25382538

25392539

Doc/whatsnew/3.7.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@ The new :c:func:`import__find__load__start` and
16741674
module imports.
16751675
(Contributed by Christian Heimes in :issue:`31574`.)
16761676

1677-
The fields :c:member:`name` and :c:member:`doc` of structures
1677+
The fields :c:member:`!name` and :c:member:`!doc` of structures
16781678
:c:type:`PyMemberDef`, :c:type:`PyGetSetDef`,
16791679
:c:type:`PyStructSequence_Field`, :c:type:`PyStructSequence_Desc`,
16801680
and :c:type:`wrapperbase` are now of type ``const char *`` rather of

0 commit comments

Comments
 (0)