Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit af61cb9

Browse files
authoredJul 26, 2023
pythongh-107091: Fix some uses of :c:member: role (pythonGH-107129)
1 parent 737d1da commit af61cb9

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed
 

‎Doc/c-api/import.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Importing Modules
154154
:class:`SourceFileLoader` otherwise.
155155
156156
The module's :attr:`__file__` attribute will be set to the code object's
157-
:c:member:`co_filename`. If applicable, :attr:`__cached__` will also
157+
:attr:`co_filename`. If applicable, :attr:`__cached__` will also
158158
be set.
159159
160160
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: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,16 @@ Implementing functions and methods
244244
245245
points to the contents of the docstring
246246
247-
The :c:member:`ml_meth` is a C function pointer. The functions may be of different
247+
The :c:member:`~PyMethodDef.ml_meth` is a C function pointer.
248+
The functions may be of different
248249
types, but they always return :c:expr:`PyObject*`. If the function is not of
249250
the :c:type:`PyCFunction`, the compiler will require a cast in the method table.
250251
Even though :c:type:`PyCFunction` defines the first parameter as
251252
:c:expr:`PyObject*`, it is common that the method implementation uses the
252253
specific C type of the *self* object.
253254
254-
The :c:member:`ml_flags` field is a bitfield which can include the following flags.
255+
The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include
256+
the following flags.
255257
The individual flags indicate either a calling convention or a binding
256258
convention.
257259
@@ -432,7 +434,7 @@ Accessing attributes of extension types
432434
The string should be static, no copy is made of it.
433435
Typically, it is defined using :c:macro:`PyDoc_STR`.
434436
435-
By default (when :c:member:`flags` is ``0``), members allow
437+
By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow
436438
both read and write access.
437439
Use the :c:macro:`Py_READONLY` flag for read-only access.
438440
Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:`Py_READONLY`.
@@ -512,7 +514,7 @@ The following flags can be used with :c:member:`PyMemberDef.flags`:
512514
513515
Can only be used as part of :c:member:`Py_tp_members <PyTypeObject.tp_members>`
514516
:c:type:`slot <PyTypeSlot>` when creating a class using negative
515-
:c:member:`~PyTypeDef.basicsize`.
517+
:c:member:`~PyType_Spec.basicsize`.
516518
It is mandatory in that case.
517519
518520
This flag is only used in :c:type:`PyTypeSlot`.

‎Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
11761176
.. c:macro:: Py_TPFLAGS_ITEMS_AT_END
11771177
11781178
Only usable with variable-size types, i.e. ones with non-zero
1179-
:c:member:`~PyObject.tp_itemsize`.
1179+
:c:member:`~PyTypeObject.tp_itemsize`.
11801180

11811181
Indicates that the variable-sized portion of an instance of this type is
11821182
at the end of the instance's memory area, at an offset of

‎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)
Please sign in to comment.