]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38600: NULL -> ``NULL``. (GH-17001)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 30 Oct 2019 19:37:16 +0000 (21:37 +0200)
committerGitHub <noreply@github.com>
Wed, 30 Oct 2019 19:37:16 +0000 (21:37 +0200)
Also fix some other formatting.

27 files changed:
Doc/c-api/arg.rst
Doc/c-api/buffer.rst
Doc/c-api/conversion.rst
Doc/c-api/coro.rst
Doc/c-api/exceptions.rst
Doc/c-api/function.rst
Doc/c-api/gen.rst
Doc/c-api/import.rst
Doc/c-api/init.rst
Doc/c-api/init_config.rst
Doc/c-api/marshal.rst
Doc/c-api/memory.rst
Doc/c-api/number.rst
Doc/c-api/object.rst
Doc/c-api/tuple.rst
Doc/c-api/type.rst
Doc/c-api/typeobj.rst
Doc/c-api/unicode.rst
Doc/c-api/veryhigh.rst
Doc/extending/extending.rst
Doc/howto/clinic.rst
Doc/library/ctypes.rst
Doc/library/gc.rst
Doc/library/socket.rst
Doc/library/winreg.rst
Doc/whatsnew/2.7.rst
Doc/whatsnew/3.4.rst

index 594fef29f2a336c1018ff696c9b80417aaa58e7d..f17c63d0b9dc93208bff058924942af853705ed9 100644 (file)
@@ -345,7 +345,7 @@ Other objects
    If the *converter* returns ``Py_CLEANUP_SUPPORTED``, it may get called a
    second time if the argument parsing eventually fails, giving the converter a
    chance to release any memory that it had already allocated. In this second
-   call, the *object* parameter will be NULL; *address* will have the same value
+   call, the *object* parameter will be ``NULL``; *address* will have the same value
    as in the original call.
 
    .. versionchanged:: 3.1
index f37b0db07cd709331ce9408c63f867baf58d701b..fc1430efa8a4bb76df0afff8732512e81869ec43 100644 (file)
@@ -130,7 +130,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
    .. c:member:: Py_ssize_t itemsize
 
       Item size in bytes of a single element. Same as the value of :func:`struct.calcsize`
-      called on non-NULL :c:member:`~Py_buffer.format` values.
+      called on non-``NULL`` :c:member:`~Py_buffer.format` values.
 
       Important exception: If a consumer requests a buffer without the
       :c:macro:`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will
@@ -199,7 +199,7 @@ a buffer, see :c:func:`PyObject_GetBuffer`.
       memory block).
 
       If all suboffsets are negative (i.e. no de-referencing is needed), then
-      this field must be NULL (the default value).
+      this field must be ``NULL`` (the default value).
 
       This type of array representation is used by the Python Imaging Library
       (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.
 
 
 Here is a function that returns a pointer to the element in an N-D array
-pointed to by an N-dimensional index when there are both non-NULL strides
+pointed to by an N-dimensional index when there are both non-``NULL`` strides
 and suboffsets::
 
    void *get_item_pointer(int ndim, void *buf, Py_ssize_t *strides,
@@ -522,4 +522,4 @@ Buffer-related functions
 
    If this function is used as part of a :ref:`getbufferproc <buffer-structs>`,
    *exporter* MUST be set to the exporting object and *flags* must be passed
-   unmodified. Otherwise, *exporter* MUST be NULL.
+   unmodified. Otherwise, *exporter* MUST be ``NULL``.
index c02fa60ae9a7c79e79a74ac815d87526e2dd2099..b310fcb5e4f91e4908b4bdc9ecb427177b377bfe 100644 (file)
@@ -32,7 +32,7 @@ NULL``.
 
 If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed to
 avoid truncation exceeds *size* by more than 512 bytes, Python aborts with a
-*Py_FatalError*.
+:c:func:`Py_FatalError`.
 
 The return value (*rv*) for these functions should be interpreted as follows:
 
@@ -95,21 +95,21 @@ The following functions provide locale-independent string to number conversions.
    must be 0 and is ignored.  The ``'r'`` format code specifies the
    standard :func:`repr` format.
 
-   *flags* can be zero or more of the values *Py_DTSF_SIGN*,
-   *Py_DTSF_ADD_DOT_0*, or *Py_DTSF_ALT*, or-ed together:
+   *flags* can be zero or more of the values ``Py_DTSF_SIGN``,
+   ``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:
 
-   * *Py_DTSF_SIGN* means to always precede the returned string with a sign
+   * ``Py_DTSF_SIGN`` means to always precede the returned string with a sign
      character, even if *val* is non-negative.
 
-   * *Py_DTSF_ADD_DOT_0* means to ensure that the returned string will not look
+   * ``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look
      like an integer.
 
-   * *Py_DTSF_ALT* means to apply "alternate" formatting rules.  See the
+   * ``Py_DTSF_ALT`` means to apply "alternate" formatting rules.  See the
      documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for
      details.
 
-   If *ptype* is non-NULL, then the value it points to will be set to one of
-   *Py_DTST_FINITE*, *Py_DTST_INFINITE*, or *Py_DTST_NAN*, signifying that
+   If *ptype* is non-``NULL``, then the value it points to will be set to one of
+   ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying that
    *val* is a finite number, an infinite number, or not a number, respectively.
 
    The return value is a pointer to *buffer* with the converted string or
index 915c57eeb55b8c4d882df753f0507edde7911291..2260944a9a93a9e897e9dbc4b04723e79a02ecab 100644 (file)
@@ -23,7 +23,7 @@ return.
 
 .. c:function:: int PyCoro_CheckExact(PyObject *ob)
 
-   Return true if *ob*'s type is *PyCoro_Type*; *ob* must not be ``NULL``.
+   Return true if *ob*'s type is :c:type:`PyCoro_Type`; *ob* must not be ``NULL``.
 
 
 .. c:function:: PyObject* PyCoro_New(PyFrameObject *frame, PyObject *name, PyObject *qualname)
index 4cb309521d4d2fff9a2faa7277d7baa6c6d356b4..c7ba74cc8d587424f5f14da84b1b4151f2673d6e 100644 (file)
@@ -19,9 +19,9 @@ return ``1`` for success and ``0`` for failure).
 
 Concretely, the error indicator consists of three object pointers: the
 exception's type, the exception's value, and the traceback object.  Any
-of those pointers can be NULL if non-set (although some combinations are
-forbidden, for example you can't have a non-NULL traceback if the exception
-type is NULL).
+of those pointers can be ``NULL`` if non-set (although some combinations are
+forbidden, for example you can't have a non-``NULL`` traceback if the exception
+type is ``NULL``).
 
 When a function must fail because some function it called failed, it generally
 doesn't set the error indicator; the function it called already set it.  It is
@@ -92,7 +92,7 @@ Raising exceptions
 
 These functions help you set the current thread's error indicator.
 For convenience, some of these functions will always return a
-NULL pointer for use in a ``return`` statement.
+``NULL`` pointer for use in a ``return`` statement.
 
 
 .. c:function:: void PyErr_SetString(PyObject *type, const char *message)
index a3cbf569f76f2cc4c662cde9c6e61c546d2258bb..bb416f4bb63aa2b16bba3cd6a1b30bc5abc7566e 100644 (file)
@@ -42,8 +42,8 @@ There are a few functions specific to Python functions.
 .. c:function:: PyObject* PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname)
 
    As :c:func:`PyFunction_New`, but also allows setting the function object's
-   ``__qualname__`` attribute.  *qualname* should be a unicode object or NULL;
-   if NULL, the ``__qualname__`` attribute is set to the same value as its
+   ``__qualname__`` attribute.  *qualname* should be a unicode object or ``NULL``;
+   if ``NULL``, the ``__qualname__`` attribute is set to the same value as its
    ``__name__`` attribute.
 
    .. versionadded:: 3.3
@@ -75,7 +75,7 @@ There are a few functions specific to Python functions.
 .. c:function:: int PyFunction_SetDefaults(PyObject *op, PyObject *defaults)
 
    Set the argument default values for the function object *op*. *defaults* must be
-   *Py_None* or a tuple.
+   ``Py_None`` or a tuple.
 
    Raises :exc:`SystemError` and returns ``-1`` on failure.
 
@@ -89,7 +89,7 @@ There are a few functions specific to Python functions.
 .. c:function:: int PyFunction_SetClosure(PyObject *op, PyObject *closure)
 
    Set the closure associated with the function object *op*. *closure* must be
-   *Py_None* or a tuple of cell objects.
+   ``Py_None`` or a tuple of cell objects.
 
    Raises :exc:`SystemError` and returns ``-1`` on failure.
 
@@ -103,6 +103,6 @@ There are a few functions specific to Python functions.
 .. c:function:: int PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
 
    Set the annotations for the function object *op*. *annotations*
-   must be a dictionary or *Py_None*.
+   must be a dictionary or ``Py_None``.
 
    Raises :exc:`SystemError` and returns ``-1`` on failure.
index e4b8d255dadba55bd5283b2a14bd1cb0a0b98693..74410927bfde107c8a8c1e4a5ee1f0a4a9302a0a 100644 (file)
@@ -27,7 +27,7 @@ than explicitly calling :c:func:`PyGen_New` or :c:func:`PyGen_NewWithQualName`.
 
 .. c:function:: int PyGen_CheckExact(PyObject *ob)
 
-   Return true if *ob*'s type is *PyGen_Type*; *ob* must not be ``NULL``.
+   Return true if *ob*'s type is :c:type:`PyGen_Type`; *ob* must not be ``NULL``.
 
 
 .. c:function:: PyObject* PyGen_New(PyFrameObject *frame)
index ee098768b124e111fcab19e6185e26fee7dc353b..c6fc33076f0f516e6b470bcce50be5f8bf3c35c0 100644 (file)
@@ -207,8 +207,8 @@ Importing Modules
 .. c:function:: PyObject* PyImport_GetModule(PyObject *name)
 
    Return the already imported module with the given name.  If the
-   module has not been imported yet then returns NULL but does not set
-   an error.  Returns NULL and sets an error if the lookup failed.
+   module has not been imported yet then returns ``NULL`` but does not set
+   an error.  Returns ``NULL`` and sets an error if the lookup failed.
 
    .. versionadded:: 3.7
 
index 61912b968fd4b4d81d082b1cfddcb17948acf3e0..dc30e496825511fc524a8758808d03213be4cd18 100644 (file)
@@ -329,7 +329,7 @@ Process-wide parameters
    It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code
    to control IO encoding when the environment variable does not work.
 
-   ``encoding`` and/or ``errors`` may be NULL to use
+   *encoding* and/or *errors* may be ``NULL`` to use
    :envvar:`PYTHONIOENCODING` and/or default values (depending on other
    settings).
 
index 5e18300471d4613da10d9a1279400f68246af28b..6b16b5bb72859a507e18ab4c5d31353310ef1c7f 100644 (file)
@@ -61,8 +61,8 @@ PyWideStringList
 
    List of ``wchar_t*`` strings.
 
-   If *length* is non-zero, *items* must be non-NULL and all strings must be
-   non-NULL.
+   If *length* is non-zero, *items* must be non-``NULL`` and all strings must be
+   non-``NULL``.
 
    Methods:
 
@@ -608,7 +608,7 @@ PyConfig
 
       :data:`sys.pycache_prefix`: ``.pyc`` cache prefix.
 
-      If NULL, :data:`sys.pycache_prefix` is set to ``None``.
+      If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``.
 
    .. c:member:: int quiet
 
index 2f580430237af685f53d6418515c3e703e3a31cf..7b179e22e290e1ce727b9fe8e66aba55b1700879 100644 (file)
@@ -16,7 +16,7 @@ Numeric values are stored with the least significant byte first.
 The module supports two versions of the data format: version 0 is the
 historical version, version 1 shares interned strings in the file, and upon
 unmarshalling.  Version 2 uses a binary format for floating point numbers.
-*Py_MARSHAL_VERSION* indicates the current file format (currently 2).
+``Py_MARSHAL_VERSION`` indicates the current file format (currently 2).
 
 
 .. c:function:: void PyMarshal_WriteLongToFile(long value, FILE *file, int version)
index c5b3af64c16a42c50b096fb83aaf9d4d586d0e6f..ba7bd3b9a53878b66748044c45d7c70d6c891463 100644 (file)
@@ -424,7 +424,7 @@ Customize Memory Allocators
 
    Set the memory block allocator of the specified domain.
 
-   The new allocator must return a distinct non-NULL pointer when requesting
+   The new allocator must return a distinct non-``NULL`` pointer when requesting
    zero bytes.
 
    For the :c:data:`PYMEM_DOMAIN_RAW` domain, the allocator must be
index 55ddb9c0c8206f564a0ffe8e36d6de61e3ef00d6..620204ca8e2295ec7f7cc4f4252fa67afc01aa73 100644 (file)
@@ -275,8 +275,8 @@ Number Protocol
    convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the
    *exc* argument is the type of exception that will be raised (usually
    :exc:`IndexError` or :exc:`OverflowError`).  If *exc* is ``NULL``, then the
-   exception is cleared and the value is clipped to *PY_SSIZE_T_MIN* for a negative
-   integer or *PY_SSIZE_T_MAX* for a positive integer.
+   exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` for a negative
+   integer or ``PY_SSIZE_T_MAX`` for a positive integer.
 
 
 .. c:function:: int PyIndex_Check(PyObject *o)
index 0b93064028b8e1e636630b2b9fa84ba27040c62b..9d1155184725b3236fd3a46071e2142ba3839f4e 100644 (file)
@@ -399,7 +399,7 @@ Object Protocol
    To get actual number of arguments, use
    :c:func:`PyVectorcall_NARGS(nargsf) <PyVectorcall_NARGS>`.
 
-   *kwnames* can be either NULL (no keyword arguments) or a tuple of keyword
+   *kwnames* can be either ``NULL`` (no keyword arguments) or a tuple of keyword
    names, which must be strings. In the latter case, the values of the keyword
    arguments are stored in *args* after the positional arguments.
    The number of keyword arguments does not influence *nargsf*.
index d74d8626d1e92efb1a4c33ebf600b85671369988..25df3974e870e2cbaf399d455290653ed76983d6 100644 (file)
@@ -153,7 +153,7 @@ type.
    | ``name``          | ``const char *``             | name of the struct sequence type     |
    +-------------------+------------------------------+--------------------------------------+
    | ``doc``           | ``const char *``             | pointer to docstring for the type    |
-   |                   |                              | or NULL to omit                      |
+   |                   |                              | or ``NULL`` to omit                  |
    +-------------------+------------------------------+--------------------------------------+
    | ``fields``        | ``PyStructSequence_Field *`` | pointer to ``NULL``-terminated array |
    |                   |                              | with field names of the new type     |
@@ -170,16 +170,16 @@ type.
    :attr:`fields` array of the :c:type:`PyStructSequence_Desc` determines which
    field of the struct sequence is described.
 
-   +-----------+------------------+----------------------------------------+
-   | Field     | C Type           | Meaning                                |
-   +===========+==================+========================================+
-   | ``name``  | ``const char *`` | name for the field or ``NULL`` to end  |
-   |           |                  | the list of named fields, set to       |
-   |           |                  | PyStructSequence_UnnamedField to       |
-   |           |                  | leave unnamed                          |
-   +-----------+------------------+----------------------------------------+
-   | ``doc``   | ``const char *`` | field docstring or ``NULL`` to omit    |
-   +-----------+------------------+----------------------------------------+
+   +-----------+------------------+-----------------------------------------+
+   | Field     | C Type           | Meaning                                 |
+   +===========+==================+=========================================+
+   | ``name``  | ``const char *`` | name for the field or ``NULL`` to end   |
+   |           |                  | the list of named fields, set to        |
+   |           |                  | :c:data:`PyStructSequence_UnnamedField` |
+   |           |                  | to leave unnamed                        |
+   +-----------+------------------+-----------------------------------------+
+   | ``doc``   | ``const char *`` | field docstring or ``NULL`` to omit     |
+   +-----------+------------------+-----------------------------------------+
 
 
 .. c:var:: char* PyStructSequence_UnnamedField
index 34b52f27ecb83f07696704f69a7b8fec1fa925bc..b1b2df9f19042f80747893a61679d357a36f4520 100644 (file)
@@ -181,7 +181,7 @@ The following functions and structs are used to create
       * ``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`
       * ``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`
 
-      The following fields cannot be set using *PyType_Spec* and *PyType_Slot*:
+      The following fields cannot be set using :c:type:`PyType_Spec` and :c:type:`PyType_Slot`:
 
       * :c:member:`~PyTypeObject.tp_dict`
       * :c:member:`~PyTypeObject.tp_mro`
index 181157e08ec43e7a891f3f9f280f3a0e7bd94924..bff5abfea48ee92c10756ed13fe0c7d6a05abb4e 100644 (file)
@@ -740,7 +740,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
    This field is inherited by subtypes together with
    :c:member:`~PyTypeObject.tp_call`: a subtype inherits
    :c:member:`~PyTypeObject.tp_vectorcall_offset` from its base type when
-   the subtype’s :c:member:`~PyTypeObject.tp_call` is NULL.
+   the subtype’s :c:member:`~PyTypeObject.tp_call` is ``NULL``.
 
    Note that `heap types`_ (including subclasses defined in Python) do not
    inherit the :const:`_Py_TPFLAGS_HAVE_VECTORCALL` flag.
@@ -1180,7 +1180,7 @@ and :c:type:`PyType_Type` effectively act as defaults.)
 
       This bit is set on *static* subtypes if ``tp_flags`` is not overridden:
       a subtype inherits ``_Py_TPFLAGS_HAVE_VECTORCALL`` from its base type
-      when the subtype’s :c:member:`~PyTypeObject.tp_call` is NULL
+      when the subtype’s :c:member:`~PyTypeObject.tp_call` is ``NULL``
       and the subtype's ``Py_TPFLAGS_HEAPTYPE`` is not set.
 
       `Heap types`_ do not inherit ``_Py_TPFLAGS_HAVE_VECTORCALL``.
@@ -1955,7 +1955,7 @@ This results in types that are limited relative to types defined in Python:
   :ref:`sub-interpreters <sub-interpreter-support>`, so they should not
   include any subinterpreter-specific state.
 
-Also, since *PyTypeObject* is not part of the :ref:`stable ABI <stable>`,
+Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI <stable>`,
 any extension modules using static types must be compiled for a specific
 Python minor version.
 
index 0359f5ec36bed42fc07b2b20e5e859faf7ad2393..2bf4a0f56bc8a3a344ea677f1b00cdf501050166 100644 (file)
@@ -526,9 +526,9 @@ APIs:
    .. note::
       The width formatter unit is number of characters rather than bytes.
       The precision formatter unit is number of bytes for ``"%s"`` and
-      ``"%V"`` (if the ``PyObject*`` argument is NULL), and a number of
+      ``"%V"`` (if the ``PyObject*`` argument is ``NULL``), and a number of
       characters for ``"%A"``, ``"%U"``, ``"%S"``, ``"%R"`` and ``"%V"``
-      (if the ``PyObject*`` argument is not NULL).
+      (if the ``PyObject*`` argument is not ``NULL``).
 
    .. [1] For integer specifiers (d, u, ld, li, lu, lld, lli, llu, zd, zi,
       zu, i, x): the 0-conversion flag has effect even when a precision is given.
@@ -1172,7 +1172,7 @@ These are the UTF-32 codec APIs:
    If byteorder is ``0``, the output string will always start with the Unicode BOM
    mark (U+FEFF). In the other two modes, no BOM mark is prepended.
 
-   If *Py_UNICODE_WIDE* is not defined, surrogate pairs will be output
+   If ``Py_UNICODE_WIDE`` is not defined, surrogate pairs will be output
    as a single code point.
 
    Return ``NULL`` if an exception was raised by the codec.
@@ -1246,7 +1246,7 @@ These are the UTF-16 codec APIs:
    If byteorder is ``0``, the output string will always start with the Unicode BOM
    mark (U+FEFF). In the other two modes, no BOM mark is prepended.
 
-   If *Py_UNICODE_WIDE* is defined, a single :c:type:`Py_UNICODE` value may get
+   If ``Py_UNICODE_WIDE`` is defined, a single :c:type:`Py_UNICODE` value may get
    represented as a surrogate pair. If it is not defined, each :c:type:`Py_UNICODE`
    values is interpreted as a UCS-2 character.
 
index fce39b5c81b2a02e02f1a2ad54cf93cb9714934c..d6aecc394c9e70a8084750df748ed06a9065f22c 100644 (file)
@@ -80,7 +80,7 @@ the same library that the Python runtime is using.
 .. c:function:: int PyRun_SimpleString(const char *command)
 
    This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below,
-   leaving the *PyCompilerFlags\** argument set to NULL.
+   leaving the :c:type:`PyCompilerFlags`\* argument set to ``NULL``.
 
 
 .. c:function:: int PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
index 7986ea1e150451d8fd6decce4e20dbe24db2de1a..5b32a2cdc5506efa302d979a76c2e8dda136040c 100644 (file)
@@ -536,7 +536,7 @@ Later, when it is time to call the function, you call the C function
 :c:func:`PyObject_CallObject`.  This function has two arguments, both pointers to
 arbitrary Python objects: the Python function, and the argument list.  The
 argument list must always be a tuple object, whose length is the number of
-arguments.  To call the Python function with no arguments, pass in NULL, or
+arguments.  To call the Python function with no arguments, pass in ``NULL``, or
 an empty tuple; to call it with one argument, pass a singleton tuple.
 :c:func:`Py_BuildValue` returns a tuple when its format string consists of zero
 or more format codes between parentheses.  For example::
index cfd9f2e4075c4aaa36512d585326ecc7810264b8..50041829b8c388cde910018c90ed64c958673352 100644 (file)
@@ -1070,7 +1070,7 @@ Currently Argument Clinic supports only a few return converters:
     DecodeFSDefault
 
 None of these take parameters.  For the first three, return -1 to indicate
-error.  For ``DecodeFSDefault``, the return type is ``const char *``; return a NULL
+error.  For ``DecodeFSDefault``, the return type is ``const char *``; return a ``NULL``
 pointer to indicate an error.
 
 (There's also an experimental ``NoneType`` converter, which lets you
index 4504a800c43ca769327cec6cf061fe03697fe9c6..1f84b7ab298393b8d27cd737dbcb7d941d13ab85 100644 (file)
@@ -152,8 +152,8 @@ the ``time()`` function, which returns system time in seconds since the Unix
 epoch, and the ``GetModuleHandleA()`` function, which returns a win32 module
 handle.
 
-This example calls both functions with a NULL pointer (``None`` should be used
-as the NULL pointer)::
+This example calls both functions with a ``NULL`` pointer (``None`` should be used
+as the ``NULL`` pointer)::
 
    >>> print(libc.time(None))  # doctest: +SKIP
    1150640792
@@ -1110,7 +1110,7 @@ Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, we
 can iterate over it, but we just have to make sure that our loop terminates,
 because pointers have no size. Sooner or later it would probably crash with an
 access violation or whatever, so it's better to break out of the loop when we
-hit the NULL entry::
+hit the ``NULL`` entry::
 
    >>> for item in table:
    ...     if item.name is None:
index 084cd6ac257ebee6815656ac89b88ec92beb37ba..366861c524c3dc9642329b4bad56fdaca7a67caa 100644 (file)
@@ -212,7 +212,7 @@ values but should not rebind them):
    A list of objects which the collector found to be unreachable but could
    not be freed (uncollectable objects).  Starting with Python 3.4, this
    list should be empty most of the time, except when using instances of
-   C extension types with a non-NULL ``tp_del`` slot.
+   C extension types with a non-``NULL`` ``tp_del`` slot.
 
    If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be
    added to this list rather than freed.
index d443e972fe98b106182e2e6f25660fa8a23d5f4b..62552bcbe24c1515b7ca3751ddf9c0c40b3fb6ae 100755 (executable)
@@ -1675,9 +1675,9 @@ to sockets.
    ``None`` or a :term:`bytes-like object` representing a buffer. In the later
    case it is up to the caller to ensure that the bytestring contains the
    proper bits (see the optional built-in module :mod:`struct` for a way to
-   encode C structures as bytestrings). When value is set to ``None``,
-   optlen argument is required. It's equivalent to call setsockopt C
-   function with optval=NULL and optlen=optlen.
+   encode C structures as bytestrings). When *value* is set to ``None``,
+   *optlen* argument is required. It's equivalent to call :c:func:`setsockopt` C
+   function with ``optval=NULL`` and ``optlen=optlen``.
 
 
    .. versionchanged:: 3.5
index cb67f2f39d7603dbcf32162a743b50c431834c3d..5e810680b2643f71f904a44f511c7f97d8d24591 100644 (file)
@@ -343,7 +343,7 @@ This module offers the following functions:
    value set by the :func:`SetValue` method for the key identified by *key*.
 
    Values in the registry have name, type, and data components. This method
-   retrieves the data for a key's first value that has a NULL name. But the
+   retrieves the data for a key's first value that has a ``NULL`` name. But the
    underlying API call doesn't return the type, so always use
    :func:`QueryValueEx` if possible.
 
@@ -391,7 +391,7 @@ This module offers the following functions:
    <https://msdn.microsoft.com/en-us/library/ms724878%28v=VS.85%29.aspx>`__
    for more details.
 
-   This function passes NULL for *security_attributes* to the API.
+   This function passes ``NULL`` for *security_attributes* to the API.
 
 
 .. function:: SetValue(key, sub_key, type, value)
index 9f8d9f202c43413370438395fede18a7891863a9..d19c8e01ad8a00e57a8d3de067af19e528472f27 100644 (file)
@@ -1169,7 +1169,7 @@ changes, or look through the Subversion logs for all the details.
   correctly copy bound instance methods.  (Implemented by
   Robert Collins; :issue:`1515`.)
 
-* The :mod:`ctypes` module now always converts ``None`` to a C NULL
+* The :mod:`ctypes` module now always converts ``None`` to a C ``NULL``
   pointer for arguments declared as pointers.  (Changed by Thomas
   Heller; :issue:`4606`.)  The underlying `libffi library
   <https://sourceware.org/libffi/>`__ has been updated to version
index 7b886e7c27a48dc5327a3db0ef02f290f53d9142..99d040840d9fb36701561bc23027dd10063410ec 100644 (file)
@@ -2509,7 +2509,7 @@ Changes in the C API
 
 * :c:func:`PyThread_set_key_value` now always set the value. In Python
   3.3, the function did nothing if the key already exists (if the current
-  value is a non-NULL pointer).
+  value is a non-``NULL`` pointer).
 
 * The ``f_tstate`` (thread state) field of the :c:type:`PyFrameObject`
   structure has been removed to fix a bug: see :issue:`14432` for the