mirror of
https://github.com/python/cpython.git
synced 2025-08-21 17:25:34 +00:00
[3.12] GH-95079: document error behaviour for some unicode C APIs (GH-95080) (#124662)
(cherry picked from commit b79a21ea42
)
Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
This commit is contained in:
parent
4d38254e20
commit
fb8d604d55
1 changed files with 9 additions and 0 deletions
|
@ -345,6 +345,8 @@ APIs:
|
||||||
This is the recommended way to allocate a new Unicode object. Objects
|
This is the recommended way to allocate a new Unicode object. Objects
|
||||||
created using this function are not resizable.
|
created using this function are not resizable.
|
||||||
|
|
||||||
|
On error, set an exception and return ``NULL``.
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
|
|
||||||
|
@ -598,6 +600,8 @@ APIs:
|
||||||
|
|
||||||
Return the length of the Unicode object, in code points.
|
Return the length of the Unicode object, in code points.
|
||||||
|
|
||||||
|
On error, set an exception and return ``-1``.
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
|
|
||||||
|
@ -641,6 +645,8 @@ APIs:
|
||||||
not out of bounds, and that the object can be modified safely (i.e. that it
|
not out of bounds, and that the object can be modified safely (i.e. that it
|
||||||
its reference count is one).
|
its reference count is one).
|
||||||
|
|
||||||
|
Return ``0`` on success, ``-1`` on error with an exception set.
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
|
|
||||||
|
@ -650,6 +656,8 @@ APIs:
|
||||||
Unicode object and the index is not out of bounds, in contrast to
|
Unicode object and the index is not out of bounds, in contrast to
|
||||||
:c:func:`PyUnicode_READ_CHAR`, which performs no error checking.
|
:c:func:`PyUnicode_READ_CHAR`, which performs no error checking.
|
||||||
|
|
||||||
|
Return character on success, ``-1`` on error with an exception set.
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
|
|
||||||
|
@ -658,6 +666,7 @@ APIs:
|
||||||
|
|
||||||
Return a substring of *unicode*, from character index *start* (included) to
|
Return a substring of *unicode*, from character index *start* (included) to
|
||||||
character index *end* (excluded). Negative indices are not supported.
|
character index *end* (excluded). Negative indices are not supported.
|
||||||
|
On error, set an exception and return ``NULL``.
|
||||||
|
|
||||||
.. versionadded:: 3.3
|
.. versionadded:: 3.3
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue