Skip to content

Commit e835b31

Browse files
bpo-38600: NULL -> NULL. (GH-17001)
Also fix some other formatting.
1 parent 1d8da61 commit e835b31

27 files changed

+68
-68
lines changed

Doc/c-api/arg.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ Other objects
345345
If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a
346346
second time if the argument parsing eventually fails, giving the converter a
347347
chance to release any memory that it had already allocated. In this second
348-
call, the *object* parameter will be NULL; *address* will have the same value
348+
call, the *object* parameter will be ``NULL``; *address* will have the same value
349349
as in the original call.
350350

351351
.. versionchanged:: 3.1

Doc/c-api/buffer.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
130130
.. c:member:: Py_ssize_t itemsize
131131
132132
Item size in bytes of a single element. Same as the value of :func:`struct.calcsize`
133-
called on non-NULL :c:member:`~Py_buffer.format` values.
133+
called on non-``NULL`` :c:member:`~Py_buffer.format` values.
134134

135135
Important exception: If a consumer requests a buffer without the
136136
:c:macro:`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will
@@ -199,7 +199,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
199199
memory block).
200200

201201
If all suboffsets are negative (i.e. no de-referencing is needed), then
202-
this field must be NULL (the default value).
202+
this field must be ``NULL`` (the default value).
203203

204204
This type of array representation is used by the Python Imaging Library
205205
(PIL). See `complex arrays`_ for further information how to access elements
@@ -407,7 +407,7 @@ to two ``char x[2][3]`` arrays that can be located anywhere in memory.
407407

408408

409409
Here is a function that returns a pointer to the element in an N-D array
410-
pointed to by an N-dimensional index when there are both non-NULL strides
410+
pointed to by an N-dimensional index when there are both non-``NULL`` strides
411411
and suboffsets::
412412

413413
void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,
@@ -522,4 +522,4 @@ Buffer-related functions
522522
523523
If this function is used as part of a :ref:`getbufferproc <buffer-structs>`,
524524
*exporter* MUST be set to the exporting object and *flags* must be passed
525-
unmodified. Otherwise, *exporter* MUST be NULL.
525+
unmodified. Otherwise, *exporter* MUST be ``NULL``.

Doc/c-api/conversion.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ NULL``.
3232
3333
If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed to
3434
avoid truncation exceeds *size* by more than 512 bytes, Python aborts with a
35-
*Py_FatalError*.
35+
:c:func:`Py_FatalError`.
3636
3737
The return value (*rv*) for these functions should be interpreted as follows:
3838
@@ -95,21 +95,21 @@ The following functions provide locale-independent string to number conversions.
9595
must be 0 and is ignored. The ``'r'`` format code specifies the
9696
standard :func:`repr` format.
9797
98-
*flags* can be zero or more of the values *Py_DTSF_SIGN*,
99-
*Py_DTSF_ADD_DOT_0*, or *Py_DTSF_ALT*, or-ed together:
98+
*flags* can be zero or more of the values ``Py_DTSF_SIGN``,
99+
``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:
100100
101-
* *Py_DTSF_SIGN* means to always precede the returned string with a sign
101+
* ``Py_DTSF_SIGN`` means to always precede the returned string with a sign
102102
character, even if *val* is non-negative.
103103
104-
* *Py_DTSF_ADD_DOT_0* means to ensure that the returned string will not look
104+
* ``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look
105105
like an integer.
106106
107-
* *Py_DTSF_ALT* means to apply "alternate" formatting rules. See the
107+
* ``Py_DTSF_ALT`` means to apply "alternate" formatting rules. See the
108108
documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
109109
details.
110110
111-
If *ptype* is non-NULL, then the value it points to will be set to one of
112-
*Py_DTST_FINITE*, *Py_DTST_INFINITE*, or *Py_DTST_NAN*, signifying that
111+
If *ptype* is non-``NULL``, then the value it points to will be set to one of
112+
``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying that
113113
*val* is a finite number, an infinite number, or not a number, respectively.
114114
115115
The return value is a pointer to *buffer* with the converted string or

Doc/c-api/coro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ return.
2323

2424
.. c:function:: int PyCoro_CheckExact(PyObject *ob)
2525
26-
Return true if *ob*'s type is *PyCoro_Type*; *ob* must not be ``NULL``.
26+
Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be ``NULL``.
2727
2828
2929
.. c:function:: PyObject* PyCoro_New(PyFrameObject *frame, PyObject *name, PyObject *qualname)

Doc/c-api/exceptions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ return ``1`` for success and ``0`` for failure).
1919

2020
Concretely, the error indicator consists of three object pointers: the
2121
exception's type, the exception's value, and the traceback object. Any
22-
of those pointers can be NULL if non-set (although some combinations are
23-
forbidden, for example you can't have a non-NULL traceback if the exception
24-
type is NULL).
22+
of those pointers can be ``NULL`` if non-set (although some combinations are
23+
forbidden, for example you can't have a non-``NULL`` traceback if the exception
24+
type is ``NULL``).
2525

2626
When a function must fail because some function it called failed, it generally
2727
doesn't set the error indicator; the function it called already set it. It is
@@ -92,7 +92,7 @@ Raising exceptions
9292
9393
These functions help you set the current thread's error indicator.
9494
For convenience, some of these functions will always return a
95-
NULL pointer for use in a ``return`` statement.
95+
``NULL`` pointer for use in a ``return`` statement.
9696
9797
9898
.. c:function:: void PyErr_SetString(PyObject *type, const char *message)

Doc/c-api/function.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ There are a few functions specific to Python functions.
4242
.. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname)
4343
4444
As :c:func:`PyFunction_New`, but also allows setting the function object's
45-
``__qualname__`` attribute. *qualname* should be a unicode object or NULL;
46-
if NULL, the ``__qualname__`` attribute is set to the same value as its
45+
``__qualname__`` attribute. *qualname* should be a unicode object or ``NULL``;
46+
if ``NULL``, the ``__qualname__`` attribute is set to the same value as its
4747
``__name__`` attribute.
4848
4949
.. versionadded:: 3.3
@@ -75,7 +75,7 @@ There are a few functions specific to Python functions.
7575
.. c:function:: int PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
7676
7777
Set the argument default values for the function object *op*. *defaults* must be
78-
*Py_None* or a tuple.
78+
``Py_None`` or a tuple.
7979
8080
Raises :exc:`SystemError` and returns ``-1`` on failure.
8181
@@ -89,7 +89,7 @@ There are a few functions specific to Python functions.
8989
.. c:function:: int PyFunction_SetClosure(PyObject *op, PyObject *closure)
9090
9191
Set the closure associated with the function object *op*. *closure* must be
92-
*Py_None* or a tuple of cell objects.
92+
``Py_None`` or a tuple of cell objects.
9393
9494
Raises :exc:`SystemError` and returns ``-1`` on failure.
9595
@@ -103,6 +103,6 @@ There are a few functions specific to Python functions.
103103
.. c:function:: int PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
104104
105105
Set the annotations for the function object *op*. *annotations*
106-
must be a dictionary or *Py_None*.
106+
must be a dictionary or ``Py_None``.
107107
108108
Raises :exc:`SystemError` and returns ``-1`` on failure.

Doc/c-api/gen.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
2727
2828
.. c:function:: int PyGen_CheckExact(PyObject *ob)
2929
30-
Return true if *ob*'s type is *PyGen_Type*; *ob* must not be ``NULL``.
30+
Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be ``NULL``.
3131
3232
3333
.. c:function:: PyObject* PyGen_New(PyFrameObject *frame)

Doc/c-api/import.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ Importing Modules
207207
.. c:function:: PyObject* PyImport_GetModule(PyObject *name)
208208
209209
Return the already imported module with the given name. If the
210-
module has not been imported yet then returns NULL but does not set
211-
an error. Returns NULL and sets an error if the lookup failed.
210+
module has not been imported yet then returns ``NULL`` but does not set
211+
an error. Returns ``NULL`` and sets an error if the lookup failed.
212212
213213
.. versionadded:: 3.7
214214

Doc/c-api/init.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ Process-wide parameters
329329
It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code
330330
to control IO encoding when the environment variable does not work.
331331
332-
``encoding`` and/or ``errors`` may be NULL to use
332+
*encoding* and/or *errors* may be ``NULL`` to use
333333
:envvar:`PYTHONIOENCODING` and/or default values (depending on other
334334
settings).
335335

Doc/c-api/init_config.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ PyWideStringList
6161
6262
List of ``wchar_t*`` strings.
6363

64-
If *length* is non-zero, *items* must be non-NULL and all strings must be
65-
non-NULL.
64+
If *length* is non-zero, *items* must be non-``NULL`` and all strings must be
65+
non-``NULL``.
6666

6767
Methods:
6868

@@ -608,7 +608,7 @@ PyConfig
608608
609609
:data:`sys.pycache_prefix`: ``.pyc`` cache prefix.
610610
611-
If NULL, :data:`sys.pycache_prefix` is set to ``None``.
611+
If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``.
612612
613613
.. c:member:: int quiet
614614

0 commit comments

Comments
 (0)