[3.8] bpo-38600: Change the mark up of NULL in the C API documentation. (GH-16950) (GH-16999)
Replace all *NULL* with ``NULL``.
(cherry picked from commit 25fc088607c855060ed142296dc1bd0125fad1af)
diff --git a/Doc/c-api/structures.rst b/Doc/c-api/structures.rst
index 5184ad5..2dc0762 100644
--- a/Doc/c-api/structures.rst
+++ b/Doc/c-api/structures.rst
@@ -106,8 +106,8 @@
Type of the functions used to implement most Python callables in C.
Functions of this type take two :c:type:`PyObject\*` parameters and return
- one such value. If the return value is *NULL*, an exception shall have
- been set. If not *NULL*, the return value is interpreted as the return
+ one such value. If the return value is ``NULL``, an exception shall have
+ been set. If not ``NULL``, the return value is interpreted as the return
value of the function as exposed in Python. The function must return a new
reference.
@@ -179,7 +179,7 @@
Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`.
The function expects three parameters: *self*, *args*, *kwargs* where
- *kwargs* is a dictionary of all the keyword arguments or possibly *NULL*
+ *kwargs* is a dictionary of all the keyword arguments or possibly ``NULL``
if there are no keyword arguments. The parameters are typically processed
using :c:func:`PyArg_ParseTupleAndKeywords`.
@@ -204,7 +204,7 @@
Keyword arguments are passed the same way as in the vectorcall protocol:
there is an additional fourth :c:type:`PyObject\*` parameter
which is a tuple representing the names of the keyword arguments
- or possibly *NULL* if there are no keywords. The values of the keyword
+ or possibly ``NULL`` if there are no keywords. The values of the keyword
arguments are stored in the *args* array, after the positional arguments.
This is not part of the :ref:`limited API <stable>`.
@@ -218,7 +218,7 @@
they are listed with the :const:`METH_NOARGS` flag. They need to be of type
:c:type:`PyCFunction`. The first parameter is typically named *self* and will
hold a reference to the module or object instance. In all cases the second
- parameter will be *NULL*.
+ parameter will be ``NULL``.
.. data:: METH_O
@@ -249,7 +249,7 @@
.. index:: builtin: staticmethod
- The method will be passed *NULL* as the first parameter rather than an
+ The method will be passed ``NULL`` as the first parameter rather than an
instance of the type. This is used to create *static methods*, similar to
what is created when using the :func:`staticmethod` built-in function.
@@ -323,7 +323,7 @@
=============== ==================
:c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that
- :c:macro:`T_OBJECT` returns ``None`` if the member is *NULL* and
+ :c:macro:`T_OBJECT` returns ``None`` if the member is ``NULL`` and
:c:macro:`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use
:c:macro:`T_OBJECT_EX` over :c:macro:`T_OBJECT` because :c:macro:`T_OBJECT_EX`
handles use of the :keyword:`del` statement on that attribute more correctly
@@ -333,7 +333,7 @@
read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies
:c:macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8.
Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX`
- members can be deleted. (They are set to *NULL*).
+ members can be deleted. (They are set to ``NULL``).
.. c:type:: PyGetSetDef
@@ -364,7 +364,7 @@
typedef PyObject *(*getter)(PyObject *, void *);
- It should return a new reference on success or *NULL* with a set exception
+ It should return a new reference on success or ``NULL`` with a set exception
on failure.
``set`` functions take two :c:type:`PyObject\*` parameters (the instance and
@@ -372,5 +372,5 @@
typedef int (*setter)(PyObject *, PyObject *, void *);
- In case the attribute should be deleted the second parameter is *NULL*.
+ In case the attribute should be deleted the second parameter is ``NULL``.
Should return ``0`` on success or ``-1`` with a set exception on failure.