summaryrefslogtreecommitdiffstats
path: root/Doc/howto
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-07-21 11:48:15 (GMT)
committerGitHub <noreply@github.com>2023-07-21 11:48:15 (GMT)
commitac9aa8a369e03784c5df7f2f8b598959fc9ef5f4 (patch)
treeebbf7a80b1c17857f0c2a16bea186817de7ad6b1 /Doc/howto
parent807afdac416356c5e4558f11a8e1cfc5f0c86dd7 (diff)
downloadcpython-ac9aa8a369e03784c5df7f2f8b598959fc9ef5f4.zip
cpython-ac9aa8a369e03784c5df7f2f8b598959fc9ef5f4.tar.gz
cpython-ac9aa8a369e03784c5df7f2f8b598959fc9ef5f4.tar.bz2
[3.12] gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) (GH-106951)
(cherry picked from commit fcc816dbff7ca66c26f57a506e4d2330fe41d0ff)
Diffstat (limited to 'Doc/howto')
-rw-r--r--Doc/howto/isolating-extensions.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/howto/isolating-extensions.rst b/Doc/howto/isolating-extensions.rst
index 8adb85f..f01801e 100644
--- a/Doc/howto/isolating-extensions.rst
+++ b/Doc/howto/isolating-extensions.rst
@@ -298,10 +298,10 @@ Watch out for the following two points in particular (but note that this is not
a comprehensive list):
* Unlike static types, heap type objects are mutable by default.
- Use the :c:data:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability.
+ Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability.
* Heap types inherit :c:member:`~PyTypeObject.tp_new` by default,
so it may become possible to instantiate them from Python code.
- You can prevent this with the :c:data:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag.
+ You can prevent this with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag.
Defining Heap Types
@@ -333,12 +333,12 @@ To avoid memory leaks, instances of heap types must implement the
garbage collection protocol.
That is, heap types should:
-- Have the :c:data:`Py_TPFLAGS_HAVE_GC` flag.
+- Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag.
- Define a traverse function using ``Py_tp_traverse``, which
visits the type (e.g. using :c:expr:`Py_VISIT(Py_TYPE(self))`).
Please refer to the :ref:`the documentation <type-structs>` of
-:c:data:`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse`
+:c:macro:`Py_TPFLAGS_HAVE_GC` and :c:member:`~PyTypeObject.tp_traverse`
for additional considerations.
If your traverse function delegates to the ``tp_traverse`` of its base class
@@ -411,7 +411,7 @@ that subclass, which may be defined in different module than yours.
pass
For a method to get its "defining class", it must use the
-:data:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`
+:ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS <METH_METHOD-METH_FASTCALL-METH_KEYWORDS>`
:c:type:`calling convention <PyMethodDef>`
and the corresponding :c:type:`PyCMethod` signature::