@@ -105,7 +105,7 @@ which disallows mutable objects such as :class:`bytearray`.
105
105
Like ``s* ``, but the Python object may also be ``None ``, in which case the
106
106
``buf `` member of the :c:type: `Py_buffer ` structure is set to ``NULL ``.
107
107
108
- ``z# `` (:class: `str `, read-only :term: `bytes-like object ` or ``None ``) [const char \* , int]
108
+ ``z# `` (:class: `str `, read-only :term: `bytes-like object ` or ``None ``) [const char \* , int or :c:type: ` Py_ssize_t ` ]
109
109
Like ``s# ``, but the Python object may also be ``None ``, in which case the C
110
110
pointer is set to ``NULL ``.
111
111
@@ -124,7 +124,7 @@ which disallows mutable objects such as :class:`bytearray`.
124
124
bytes-like objects. **This is the recommended way to accept
125
125
binary data. **
126
126
127
- ``y# `` (read-only :term: `bytes-like object `) [const char \* , int]
127
+ ``y# `` (read-only :term: `bytes-like object `) [const char \* , int or :c:type: ` Py_ssize_t ` ]
128
128
This variant on ``s# `` doesn't accept Unicode objects, only bytes-like
129
129
objects.
130
130
@@ -155,7 +155,7 @@ which disallows mutable objects such as :class:`bytearray`.
155
155
Part of the old-style :c:type: `Py_UNICODE ` API; please migrate to using
156
156
:c:func: `PyUnicode_AsWideCharString `.
157
157
158
- ``u# `` (:class: `str `) [const Py_UNICODE \* , int]
158
+ ``u# `` (:class: `str `) [const Py_UNICODE \* , int or :c:type: ` Py_ssize_t ` ]
159
159
This variant on ``u `` stores into two C variables, the first one a pointer to a
160
160
Unicode data buffer, the second one its length. This variant allows
161
161
null code points.
@@ -172,7 +172,7 @@ which disallows mutable objects such as :class:`bytearray`.
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
- ``Z# `` (:class: `str ` or ``None ``) [const Py_UNICODE \* , int]
175
+ ``Z# `` (:class: `str ` or ``None ``) [const Py_UNICODE \* , int or :c:type: ` Py_ssize_t ` ]
176
176
Like ``u# ``, but the Python object may also be ``None ``, in which case the
177
177
:c:type: `Py_UNICODE ` pointer is set to ``NULL ``.
178
178
@@ -213,7 +213,7 @@ which disallows mutable objects such as :class:`bytearray`.
213
213
recoding them. Instead, the implementation assumes that the byte string object uses
214
214
the encoding passed in as parameter.
215
215
216
- ``es# `` (:class: `str `) [const char \* encoding, char \*\* buffer, int \* buffer_length]
216
+ ``es# `` (:class: `str `) [const char \* encoding, char \*\* buffer, int or :c:type: ` Py_ssize_t ` \* buffer_length]
217
217
This variant on ``s# `` is used for encoding Unicode into a character buffer.
218
218
Unlike the ``es `` format, this variant allows input data which contains NUL
219
219
characters.
@@ -244,7 +244,7 @@ which disallows mutable objects such as :class:`bytearray`.
244
244
In both cases, *\* buffer_length * is set to the length of the encoded data
245
245
without the trailing NUL byte.
246
246
247
- ``et# `` (:class: `str `, :class: `bytes ` or :class: `bytearray `) [const char \* encoding, char \*\* buffer, int \* buffer_length]
247
+ ``et# `` (:class: `str `, :class: `bytes ` or :class: `bytearray `) [const char \* encoding, char \*\* buffer, int or :c:type: ` Py_ssize_t ` \* buffer_length]
248
248
Same as ``es# `` except that byte string objects are passed through without recoding
249
249
them. Instead, the implementation assumes that the byte string object uses the
250
250
encoding passed in as parameter.
@@ -549,7 +549,7 @@ Building values
549
549
Convert a null-terminated C string to a Python :class:`str` object using ``'utf-8'``
550
550
encoding. If the C string pointer is ``NULL``, ``None`` is used.
551
551
552
- ``s#`` (:class:`str` or ``None``) [const char \*, int ]
552
+ ``s#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t` ]
553
553
Convert a C string and its length to a Python :class:`str` object using ``' utf-8' ``
554
554
encoding. If the C string pointer is ``NULL ``, the length is ignored and
555
555
``None`` is returned.
@@ -558,30 +558,30 @@ Building values
558
558
This converts a C string to a Python :class:`bytes` object. If the C
559
559
string pointer is ``NULL``, ``None`` is returned.
560
560
561
- ``y#`` (:class:`bytes`) [const char \*, int ]
561
+ ``y#`` (:class:`bytes`) [const char \*, int or :c:type:`Py_ssize_t` ]
562
562
This converts a C string and its lengths to a Python object. If the C
563
563
string pointer is ``NULL ``, ``None`` is returned.
564
564
565
565
``z `` (:class: `str ` or ``None ``) [const char \*]
566
566
Same as ``s``.
567
567
568
- ``z#`` (:class:`str` or ``None``) [const char \*, int ]
568
+ ``z#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t` ]
569
569
Same as ``s#``.
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
573
data to a Python Unicode object. If the Unicode buffer pointer is ``NULL``,
574
574
``None`` is returned.
575
575
576
- ``u#`` (:class:`str`) [const wchar_t \*, int ]
576
+ ``u#`` (:class:`str`) [const wchar_t \*, int or :c:type:`Py_ssize_t` ]
577
577
Convert a Unicode (UTF-16 or UCS-4) data buffer and its length to a Python
578
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 \*]
582
582
Same as ``s``.
583
583
584
- ``U#`` (:class:`str` or ``None``) [const char \*, int ]
584
+ ``U#`` (:class:`str` or ``None``) [const char \*, int or :c:type:`Py_ssize_t` ]
585
585
Same as ``s#``.
586
586
587
587
``i `` (:class: `int `) [int]
0 commit comments