@@ -130,7 +130,7 @@ access to internal read-only data of Unicode objects:
130
130
Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4
131
131
integer types for direct character access. No checks are performed if the
132
132
canonical representation has the correct character size; use
133
- :c:func: `PyUnicode_KIND ` to select the right macro . Make sure
133
+ :c:func: `PyUnicode_KIND ` to select the right function . Make sure
134
134
:c:func: `PyUnicode_READY ` has been called before accessing this.
135
135
136
136
.. versionadded :: 3.3
@@ -360,40 +360,41 @@ These APIs can be used for fast direct character conversions:
360
360
.. c:function:: int Py_UNICODE_TODECIMAL(Py_UCS4 ch)
361
361
362
362
Return the character *ch* converted to a decimal positive integer. Return
363
- ``-1`` if this is not possible. This macro does not raise exceptions.
363
+ ``-1`` if this is not possible. This function does not raise exceptions.
364
364
365
365
366
366
.. c:function:: int Py_UNICODE_TODIGIT(Py_UCS4 ch)
367
367
368
368
Return the character *ch* converted to a single digit integer. Return ``-1`` if
369
- this is not possible. This macro does not raise exceptions.
369
+ this is not possible. This function does not raise exceptions.
370
370
371
371
372
372
.. c:function:: double Py_UNICODE_TONUMERIC(Py_UCS4 ch)
373
373
374
374
Return the character *ch* converted to a double. Return ``-1.0`` if this is not
375
- possible. This macro does not raise exceptions.
375
+ possible. This function does not raise exceptions.
376
376
377
377
378
378
These APIs can be used to work with surrogates:
379
379
380
- .. c:macro :: Py_UNICODE_IS_SURROGATE(ch)
380
+ .. c:func :: int Py_UNICODE_IS_SURROGATE(Py_UCS4 ch)
381
381
382
382
Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF ``).
383
383
384
- .. c:macro :: Py_UNICODE_IS_HIGH_SURROGATE(ch)
384
+ .. c:func :: int Py_UNICODE_IS_HIGH_SURROGATE(Py_UCS4 ch)
385
385
386
386
Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF ``).
387
387
388
- .. c:macro :: Py_UNICODE_IS_LOW_SURROGATE(ch)
388
+ .. c:func :: int Py_UNICODE_IS_LOW_SURROGATE(Py_UCS4 ch)
389
389
390
390
Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF ``).
391
391
392
- .. c:macro :: Py_UNICODE_JOIN_SURROGATES(high, low)
392
+ .. c:func :: Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low)
393
393
394
- Join two surrogate characters and return a single Py_UCS4 value.
394
+ Join two surrogate characters and return a single :c:type:` Py_UCS4` value.
395
395
*high* and *low* are respectively the leading and trailing surrogates in a
396
- surrogate pair.
396
+ surrogate pair. *high* must be in the range [0xD800; 0xDBFF ] and *low* must
397
+ be in the range [0xDC00; 0xDFFF].
397
398
398
399
399
400
Creating and accessing Unicode strings
0 commit comments