@@ -194,10 +194,10 @@ which disallows mutable objects such as :class:`bytearray`.
194
194
It only works for encoded data without embedded NUL bytes.
195
195
196
196
This format requires two arguments. The first is only used as input, and
197
- must be a :c:type : `const char* ` which points to the name of an encoding as a
197
+ must be a :c:expr : `const char* ` which points to the name of an encoding as a
198
198
NUL-terminated string, or ``NULL ``, in which case ``'utf-8' `` encoding is used.
199
199
An exception is raised if the named encoding is not known to Python. The
200
- second argument must be a :c:type : `char** `; the value of the pointer it
200
+ second argument must be a :c:expr : `char** `; the value of the pointer it
201
201
references will be set to a buffer with the contents of the argument text.
202
202
The text will be encoded in the encoding specified by the first argument.
203
203
@@ -217,10 +217,10 @@ which disallows mutable objects such as :class:`bytearray`.
217
217
characters.
218
218
219
219
It requires three arguments. The first is only used as input, and must be a
220
- :c:type : `const char* ` which points to the name of an encoding as a
220
+ :c:expr : `const char* ` which points to the name of an encoding as a
221
221
NUL-terminated string, or ``NULL ``, in which case ``'utf-8' `` encoding is used.
222
222
An exception is raised if the named encoding is not known to Python. The
223
- second argument must be a :c:type : `char** `; the value of the pointer it
223
+ second argument must be a :c:expr : `char** `; the value of the pointer it
224
224
references will be set to a buffer with the contents of the argument text.
225
225
The text will be encoded in the encoding specified by the first argument.
226
226
The third argument must be a pointer to an integer; the referenced integer
@@ -252,59 +252,59 @@ Numbers
252
252
253
253
``b `` (:class: `int `) [unsigned char]
254
254
Convert a nonnegative Python integer to an unsigned tiny int, stored in a C
255
- :c:type : `unsigned char `.
255
+ :c:expr : `unsigned char `.
256
256
257
257
``B `` (:class: `int `) [unsigned char]
258
258
Convert a Python integer to a tiny int without overflow checking, stored in a C
259
- :c:type : `unsigned char `.
259
+ :c:expr : `unsigned char `.
260
260
261
261
``h `` (:class: `int `) [short int]
262
- Convert a Python integer to a C :c:type : `short int `.
262
+ Convert a Python integer to a C :c:expr : `short int `.
263
263
264
264
``H `` (:class: `int `) [unsigned short int]
265
- Convert a Python integer to a C :c:type : `unsigned short int `, without overflow
265
+ Convert a Python integer to a C :c:expr : `unsigned short int `, without overflow
266
266
checking.
267
267
268
268
``i `` (:class: `int `) [int]
269
- Convert a Python integer to a plain C :c:type : `int `.
269
+ Convert a Python integer to a plain C :c:expr : `int `.
270
270
271
271
``I `` (:class: `int `) [unsigned int]
272
- Convert a Python integer to a C :c:type : `unsigned int `, without overflow
272
+ Convert a Python integer to a C :c:expr : `unsigned int `, without overflow
273
273
checking.
274
274
275
275
``l `` (:class: `int `) [long int]
276
- Convert a Python integer to a C :c:type : `long int `.
276
+ Convert a Python integer to a C :c:expr : `long int `.
277
277
278
278
``k `` (:class: `int `) [unsigned long]
279
- Convert a Python integer to a C :c:type : `unsigned long ` without
279
+ Convert a Python integer to a C :c:expr : `unsigned long ` without
280
280
overflow checking.
281
281
282
282
``L `` (:class: `int `) [long long]
283
- Convert a Python integer to a C :c:type : `long long `.
283
+ Convert a Python integer to a C :c:expr : `long long `.
284
284
285
285
``K `` (:class: `int `) [unsigned long long]
286
- Convert a Python integer to a C :c:type : `unsigned long long `
286
+ Convert a Python integer to a C :c:expr : `unsigned long long `
287
287
without overflow checking.
288
288
289
289
``n `` (:class: `int `) [:c:type: `Py_ssize_t `]
290
290
Convert a Python integer to a C :c:type: `Py_ssize_t `.
291
291
292
292
``c `` (:class: `bytes ` or :class: `bytearray ` of length 1) [char]
293
293
Convert a Python byte, represented as a :class: `bytes ` or
294
- :class: `bytearray ` object of length 1, to a C :c:type : `char `.
294
+ :class: `bytearray ` object of length 1, to a C :c:expr : `char `.
295
295
296
296
.. versionchanged :: 3.3
297
297
Allow :class: `bytearray ` objects.
298
298
299
299
``C `` (:class: `str ` of length 1) [int]
300
300
Convert a Python character, represented as a :class: `str ` object of
301
- length 1, to a C :c:type : `int `.
301
+ length 1, to a C :c:expr : `int `.
302
302
303
303
``f `` (:class: `float `) [float]
304
- Convert a Python floating point number to a C :c:type : `float `.
304
+ Convert a Python floating point number to a C :c:expr : `float `.
305
305
306
306
``d `` (:class: `float `) [double]
307
- Convert a Python floating point number to a C :c:type : `double `.
307
+ Convert a Python floating point number to a C :c:expr : `double `.
308
308
309
309
``D `` (:class: `complex `) [Py_complex]
310
310
Convert a Python complex number to a C :c:type: `Py_complex ` structure.
@@ -329,13 +329,13 @@ Other objects
329
329
``O& `` (object) [*converter *, *anything *]
330
330
Convert a Python object to a C variable through a *converter * function. This
331
331
takes two arguments: the first is a function, the second is the address of a C
332
- variable (of arbitrary type), converted to :c:type : `void * `. The *converter *
332
+ variable (of arbitrary type), converted to :c:expr : `void * `. The *converter *
333
333
function in turn is called as follows::
334
334
335
335
status = converter(object, address);
336
336
337
337
where *object * is the Python object to be converted and *address * is the
338
- :c:type : `void* ` argument that was passed to the :c:func: ` PyArg_Parse\* ` function.
338
+ :c:expr : `void* ` argument that was passed to the `` PyArg_Parse* ` ` function.
339
339
The returned *status * should be ``1 `` for a successful conversion and ``0 `` if
340
340
the conversion has failed. When the conversion fails, the *converter * function
341
341
should raise an exception and leave the content of *address * unmodified.
@@ -568,7 +568,7 @@ Building values
568
568
Same as ``s#``.
569
569
570
570
``u `` (:class: `str `) [const wchar_t \*]
571
- Convert a null-terminated :c:type :`wchar_t` buffer of Unicode (UTF-16 or UCS-4)
571
+ Convert a null-terminated :c:expr :`wchar_t` buffer of Unicode (UTF-16 or UCS-4)
572
572
data to a Python Unicode object. If the Unicode buffer pointer is ``NULL``,
573
573
``None`` is returned.
574
574
@@ -584,51 +584,51 @@ Building values
584
584
Same as ``s#``.
585
585
586
586
``i `` (:class: `int `) [int]
587
- Convert a plain C :c:type :`int` to a Python integer object.
587
+ Convert a plain C :c:expr :`int` to a Python integer object.
588
588
589
589
``b`` (:class: `int `) [char]
590
- Convert a plain C :c:type :`char` to a Python integer object.
590
+ Convert a plain C :c:expr :`char` to a Python integer object.
591
591
592
592
``h`` (:class: `int `) [short int]
593
- Convert a plain C :c:type :`short int` to a Python integer object.
593
+ Convert a plain C :c:expr :`short int` to a Python integer object.
594
594
595
595
``l`` (:class: `int `) [long int]
596
- Convert a C :c:type :`long int` to a Python integer object.
596
+ Convert a C :c:expr :`long int` to a Python integer object.
597
597
598
598
``B`` (:class: `int `) [unsigned char]
599
- Convert a C :c:type :`unsigned char` to a Python integer object.
599
+ Convert a C :c:expr :`unsigned char` to a Python integer object.
600
600
601
601
``H`` (:class: `int `) [unsigned short int]
602
- Convert a C :c:type :`unsigned short int` to a Python integer object.
602
+ Convert a C :c:expr :`unsigned short int` to a Python integer object.
603
603
604
604
``I`` (:class: `int `) [unsigned int]
605
- Convert a C :c:type :`unsigned int` to a Python integer object.
605
+ Convert a C :c:expr :`unsigned int` to a Python integer object.
606
606
607
607
``k`` (:class: `int `) [unsigned long]
608
- Convert a C :c:type :`unsigned long` to a Python integer object.
608
+ Convert a C :c:expr :`unsigned long` to a Python integer object.
609
609
610
610
``L`` (:class: `int `) [long long]
611
- Convert a C :c:type :`long long` to a Python integer object.
611
+ Convert a C :c:expr :`long long` to a Python integer object.
612
612
613
613
``K`` (:class: `int `) [unsigned long long]
614
- Convert a C :c:type :`unsigned long long` to a Python integer object.
614
+ Convert a C :c:expr :`unsigned long long` to a Python integer object.
615
615
616
616
``n`` (:class: `int `) [:c:type:`Py_ssize_t`]
617
617
Convert a C :c:type:`Py_ssize_t` to a Python integer.
618
618
619
619
``c`` (:class: `bytes ` of length 1) [char]
620
- Convert a C :c:type :`int` representing a byte to a Python :class:`bytes` object of
620
+ Convert a C :c:expr :`int` representing a byte to a Python :class:`bytes` object of
621
621
length 1.
622
622
623
623
``C`` (:class: `str ` of length 1) [int]
624
- Convert a C :c:type :`int` representing a character to Python :class:`str`
624
+ Convert a C :c:expr :`int` representing a character to Python :class:`str`
625
625
object of length 1.
626
626
627
627
``d`` (:class: `float `) [double]
628
- Convert a C :c:type :`double` to a Python floating point number.
628
+ Convert a C :c:expr :`double` to a Python floating point number.
629
629
630
630
``f`` (:class: `float `) [float]
631
- Convert a C :c:type :`float` to a Python floating point number.
631
+ Convert a C :c:expr :`float` to a Python floating point number.
632
632
633
633
``D`` (:class: `complex `) [Py_complex \*]
634
634
Convert a C :c:type:`Py_complex` structure to a Python complex number.
@@ -651,7 +651,7 @@ Building values
651
651
652
652
``O&`` (object) [*converter*, *anything*]
653
653
Convert *anything* to a Python object through a *converter* function. The
654
- function is called with *anything* (which should be compatible with :c:type : `void* `)
654
+ function is called with *anything* (which should be compatible with :c:expr : `void* `)
655
655
as its argument and should return a "new" Python object, or ``NULL`` if an
656
656
error occurred.
657
657
0 commit comments