@@ -50,7 +50,7 @@ Unless otherwise stated, buffers are not NUL-terminated.
50
50
51
51
Some formats require a read-only :term: `bytes-like object `, and set a
52
52
pointer instead of a buffer structure. They work by checking that
53
- the object's :c:member: `PyBufferProcs.bf_releasebuffer ` field is * NULL * ,
53
+ the object's :c:member: `PyBufferProcs.bf_releasebuffer ` field is `` NULL `` ,
54
54
which disallows mutable objects such as :class: `bytearray `.
55
55
56
56
.. note ::
@@ -99,15 +99,15 @@ which disallows mutable objects such as :class:`bytearray`.
99
99
100
100
``z `` (:class: `str ` or ``None ``) [const char \* ]
101
101
Like ``s ``, but the Python object may also be ``None ``, in which case the C
102
- pointer is set to * NULL * .
102
+ pointer is set to `` NULL `` .
103
103
104
104
``z* `` (:class: `str `, :term: `bytes-like object ` or ``None ``) [Py_buffer]
105
105
Like ``s* ``, but the Python object may also be ``None ``, in which case the
106
- ``buf `` member of the :c:type: `Py_buffer ` structure is set to * NULL * .
106
+ ``buf `` member of the :c:type: `Py_buffer ` structure is set to `` NULL `` .
107
107
108
108
``z# `` (:class: `str `, read-only :term: `bytes-like object ` or ``None ``) [const char \* , int]
109
109
Like ``s# ``, but the Python object may also be ``None ``, in which case the C
110
- pointer is set to * NULL * .
110
+ pointer is set to `` NULL `` .
111
111
112
112
``y `` (read-only :term: `bytes-like object `) [const char \* ]
113
113
This format converts a bytes-like object to a C pointer to a character
@@ -166,15 +166,15 @@ which disallows mutable objects such as :class:`bytearray`.
166
166
167
167
``Z `` (:class: `str ` or ``None ``) [const Py_UNICODE \* ]
168
168
Like ``u ``, but the Python object may also be ``None ``, in which case the
169
- :c:type: `Py_UNICODE ` pointer is set to * NULL * .
169
+ :c:type: `Py_UNICODE ` pointer is set to `` NULL `` .
170
170
171
171
.. deprecated-removed :: 3.3 4.0
172
172
Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
173
173
:c:func: `PyUnicode_AsWideCharString `.
174
174
175
175
``Z# `` (:class: `str ` or ``None ``) [const Py_UNICODE \* , int]
176
176
Like ``u# ``, but the Python object may also be ``None ``, in which case the
177
- :c:type: `Py_UNICODE ` pointer is set to * NULL * .
177
+ :c:type: `Py_UNICODE ` pointer is set to `` NULL `` .
178
178
179
179
.. deprecated-removed :: 3.3 4.0
180
180
Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
@@ -197,7 +197,7 @@ which disallows mutable objects such as :class:`bytearray`.
197
197
198
198
This format requires two arguments. The first is only used as input, and
199
199
must be a :c:type: `const char\* ` which points to the name of an encoding as a
200
- NUL-terminated string, or * NULL * , in which case ``'utf-8' `` encoding is used.
200
+ NUL-terminated string, or `` NULL `` , in which case ``'utf-8' `` encoding is used.
201
201
An exception is raised if the named encoding is not known to Python. The
202
202
second argument must be a :c:type: `char\*\* `; the value of the pointer it
203
203
references will be set to a buffer with the contents of the argument text.
@@ -220,7 +220,7 @@ which disallows mutable objects such as :class:`bytearray`.
220
220
221
221
It requires three arguments. The first is only used as input, and must be a
222
222
:c:type: `const char\* ` which points to the name of an encoding as a
223
- NUL-terminated string, or * NULL * , in which case ``'utf-8' `` encoding is used.
223
+ NUL-terminated string, or `` NULL `` , in which case ``'utf-8' `` encoding is used.
224
224
An exception is raised if the named encoding is not known to Python. The
225
225
second argument must be a :c:type: `char\*\* `; the value of the pointer it
226
226
references will be set to a buffer with the contents of the argument text.
@@ -230,12 +230,12 @@ which disallows mutable objects such as :class:`bytearray`.
230
230
231
231
There are two modes of operation:
232
232
233
- If *\* buffer * points a * NULL * pointer, the function will allocate a buffer of
233
+ If *\* buffer * points a `` NULL `` pointer, the function will allocate a buffer of
234
234
the needed size, copy the encoded data into this buffer and set *\* buffer * to
235
235
reference the newly allocated storage. The caller is responsible for calling
236
236
:c:func: `PyMem_Free ` to free the allocated buffer after usage.
237
237
238
- If *\* buffer * points to a non-* NULL * pointer (an already allocated buffer),
238
+ If *\* buffer * points to a non-`` NULL `` pointer (an already allocated buffer),
239
239
:c:func: `PyArg_ParseTuple ` will use this location as the buffer and interpret the
240
240
initial value of *\* buffer_length * as the buffer size. It will then copy the
241
241
encoded data into the buffer and NUL-terminate it. If the buffer is not large
@@ -317,7 +317,7 @@ Other objects
317
317
``O `` (object) [PyObject \* ]
318
318
Store a Python object (without any conversion) in a C object pointer. The C
319
319
program thus receives the actual object that was passed. The object's reference
320
- count is not increased. The pointer stored is not * NULL * .
320
+ count is not increased. The pointer stored is not `` NULL `` .
321
321
322
322
``O! `` (object) [*typeobject *, PyObject \* ]
323
323
Store a Python object in a C object pointer. This is similar to ``O ``, but
@@ -437,7 +437,7 @@ API Functions
437
437
438
438
Parse the parameters of a function that takes both positional and keyword
439
439
parameters into local variables. The *keywords * argument is a
440
- * NULL * -terminated array of keyword parameter names. Empty names denote
440
+ `` NULL `` -terminated array of keyword parameter names. Empty names denote
441
441
:ref: `positional-only parameters <positional-only_parameter >`.
442
442
Returns true on success; on failure, it returns false and raises the
443
443
appropriate exception.
@@ -520,8 +520,8 @@ Building values
520
520
521
521
Create a new value based on a format string similar to those accepted by the
522
522
:c:func: `PyArg_Parse\* ` family of functions and a sequence of values. Returns
523
- the value or * NULL * in the case of an error; an exception will be raised if
524
- * NULL * is returned.
523
+ the value or `` NULL `` in the case of an error; an exception will be raised if
524
+ `` NULL `` is returned.
525
525
526
526
:c:func: `Py_BuildValue ` does not always build a tuple. It builds a tuple only if
527
527
its format string contains two or more format units. If the format string is
@@ -547,20 +547,20 @@ Building values
547
547
548
548
``s`` (:class: `str ` or ``None ``) [const char \*]
549
549
Convert a null-terminated C string to a Python :class:`str` object using ``'utf-8'``
550
- encoding. If the C string pointer is * NULL* , ``None`` is used.
550
+ encoding. If the C string pointer is `` NULL`` , ``None`` is used.
551
551
552
552
``s#`` (:class:`str` or ``None``) [const char \*, int ]
553
553
Convert a C string and its length to a Python :class:`str` object using ``' utf-8' ``
554
- encoding. If the C string pointer is * NULL * , the length is ignored and
554
+ encoding. If the C string pointer is `` NULL `` , the length is ignored and
555
555
``None`` is returned.
556
556
557
557
``y `` (:class: `bytes `) [const char \*]
558
558
This converts a C string to a Python :class:`bytes` object. If the C
559
- string pointer is * NULL* , ``None`` is returned.
559
+ string pointer is `` NULL`` , ``None`` is returned.
560
560
561
561
``y#`` (:class:`bytes`) [const char \*, int ]
562
562
This converts a C string and its lengths to a Python object. If the C
563
- string pointer is * NULL * , ``None`` is returned.
563
+ string pointer is `` NULL `` , ``None`` is returned.
564
564
565
565
``z `` (:class: `str ` or ``None ``) [const char \*]
566
566
Same as ``s``.
@@ -570,12 +570,12 @@ Building values
570
570
571
571
``u `` (:class: `str `) [const wchar_t \*]
572
572
Convert a null-terminated :c:type:`wchar_t` buffer of Unicode (UTF-16 or UCS-4)
573
- data to a Python Unicode object. If the Unicode buffer pointer is * NULL* ,
573
+ data to a Python Unicode object. If the Unicode buffer pointer is `` NULL`` ,
574
574
``None`` is returned.
575
575
576
576
``u#`` (:class:`str`) [const wchar_t \*, int ]
577
577
Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python
578
- Unicode object. If the Unicode buffer pointer is * NULL* , the length is ignored
578
+ Unicode object. If the Unicode buffer pointer is `` NULL`` , the length is ignored
579
579
and ``None`` is returned.
580
580
581
581
``U`` (:class: `str ` or ``None ``) [const char \*]
@@ -636,9 +636,9 @@ Building values
636
636
637
637
``O`` (object) [PyObject \*]
638
638
Pass a Python object untouched (except for its reference count, which is
639
- incremented by one). If the object passed in is a * NULL* pointer, it is assumed
639
+ incremented by one). If the object passed in is a `` NULL`` pointer, it is assumed
640
640
that this was caused because the call producing the argument found an error and
641
- set an exception. Therefore, :c:func:`Py_BuildValue` will return * NULL* but won't
641
+ set an exception. Therefore, :c:func:`Py_BuildValue` will return `` NULL`` but won't
642
642
raise an exception. If no exception has been raised yet, :exc:`SystemError` is
643
643
set.
644
644
@@ -653,7 +653,7 @@ Building values
653
653
``O&`` (object) [*converter*, *anything*]
654
654
Convert *anything* to a Python object through a *converter* function. The
655
655
function is called with *anything* (which should be compatible with :c:type: `void
656
- \* `) as its argument and should return a "new" Python object, or * NULL* if an
656
+ \* `) as its argument and should return a "new" Python object, or `` NULL`` if an
657
657
error occurred.
658
658
659
659
``(items)`` (:class: `tuple `) [*matching-items*]
@@ -668,7 +668,7 @@ Building values
668
668
respectively.
669
669
670
670
If there is an error in the format string, the :exc: `SystemError ` exception is
671
- set and * NULL * returned.
671
+ set and `` NULL `` returned.
672
672
673
673
.. c :function :: PyObject* Py_VaBuildValue (const char *format, va_list vargs)
674
674
0 commit comments