summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/typeobj.rst
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-07-27 00:52:40 (GMT)
committerGitHub <noreply@github.com>2023-07-27 00:52:40 (GMT)
commit8d61a71f9c81619e34d4a30b625922ebc83c561b (patch)
treebd75cd21a961bbf99156b29a5eeb853ba61366b1 /Doc/c-api/typeobj.rst
parent391e03fa05b80d17a14ac88d30c974fa2fa00adb (diff)
downloadcpython-8d61a71f9c81619e34d4a30b625922ebc83c561b.zip
cpython-8d61a71f9c81619e34d4a30b625922ebc83c561b.tar.gz
cpython-8d61a71f9c81619e34d4a30b625922ebc83c561b.tar.bz2
gh-107298: Fix more Sphinx warnings in the C API doc (#107329)
Declare the following functions as macros, since they are actually macros. It avoids a warning on "TYPE" or "macro" argument. * PyMem_New() * PyMem_Resize() * PyModule_AddIntMacro() * PyModule_AddStringMacro() * PyObject_GC_New() * PyObject_GC_NewVar() * PyObject_New() * PyObject_NewVar() Add C standard C types to nitpick_ignore in Doc/conf.py: * int64_t * uint64_t * uintptr_t No longer ignore non existing "__int" type in nitpick_ignore. Update Doc/tools/.nitignore
Diffstat (limited to 'Doc/c-api/typeobj.rst')
-rw-r--r--Doc/c-api/typeobj.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 2b21a34..7abb477 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -579,7 +579,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
name, followed by a dot, followed by the type name; for built-in types, it
should be just the type name. If the module is a submodule of a package, the
full package name is part of the full module name. For example, a type named
- :class:`T` defined in module :mod:`!M` in subpackage :mod:`!Q` in package :mod:`!P`
+ :class:`!T` defined in module :mod:`!M` in subpackage :mod:`!Q` in package :mod:`!P`
should have the :c:member:`~PyTypeObject.tp_name` initializer ``"P.Q.M.T"``.
For :ref:`dynamically allocated type objects <heap-types>`,
@@ -673,9 +673,9 @@ and :c:data:`PyType_Type` effectively act as defaults.)
permissible to call the object deallocator directly instead of via
:c:member:`~PyTypeObject.tp_free`. The object deallocator should be the one used to allocate the
instance; this is normally :c:func:`PyObject_Del` if the instance was allocated
- using :c:func:`PyObject_New` or :c:func:`PyObject_VarNew`, or
+ using :c:macro:`PyObject_New` or :c:macro:`PyObject_NewVar`, or
:c:func:`PyObject_GC_Del` if the instance was allocated using
- :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`.
+ :c:macro:`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar`.
If the type supports garbage collection (has the :c:macro:`Py_TPFLAGS_HAVE_GC`
flag bit set), the destructor should call :c:func:`PyObject_GC_UnTrack`
@@ -1092,7 +1092,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
.. c:macro:: Py_TPFLAGS_HAVE_GC
This bit is set when the object supports garbage collection. If this bit
- is set, instances must be created using :c:func:`PyObject_GC_New` and
+ is set, instances must be created using :c:macro:`PyObject_GC_New` and
destroyed using :c:func:`PyObject_GC_Del`. More information in section
:ref:`supporting-cycle-detection`. This bit also implies that the
GC-related fields :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` are present in
@@ -1180,7 +1180,7 @@ and :c:data:`PyType_Type` effectively act as defaults.)
Indicates that the variable-sized portion of an instance of this type is
at the end of the instance's memory area, at an offset of
- :c:expr:`Py_TYPE(obj)->tp_basicsize` (which may be different in each
+ ``Py_TYPE(obj)->tp_basicsize`` (which may be different in each
subclass).
When setting this flag, be sure that all superclasses either