Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b79a21e

Browse files
authored
GH-95079: document error behaviour for some unicode C APIs (#95080)
1 parent 5329d1b commit b79a21e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Doc/c-api/unicode.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ APIs:
338338
This is the recommended way to allocate a new Unicode object. Objects
339339
created using this function are not resizable.
340340
341+
On error, set an exception and return ``NULL``.
342+
341343
.. versionadded:: 3.3
342344
343345
@@ -614,6 +616,8 @@ APIs:
614616
615617
Return the length of the Unicode object, in code points.
616618
619+
On error, set an exception and return ``-1``.
620+
617621
.. versionadded:: 3.3
618622
619623
@@ -657,6 +661,8 @@ APIs:
657661
not out of bounds, and that the object can be modified safely (i.e. that it
658662
its reference count is one).
659663
664+
Return ``0`` on success, ``-1`` on error with an exception set.
665+
660666
.. versionadded:: 3.3
661667
662668
@@ -666,6 +672,8 @@ APIs:
666672
Unicode object and the index is not out of bounds, in contrast to
667673
:c:func:`PyUnicode_READ_CHAR`, which performs no error checking.
668674
675+
Return character on success, ``-1`` on error with an exception set.
676+
669677
.. versionadded:: 3.3
670678
671679
@@ -674,6 +682,7 @@ APIs:
674682
675683
Return a substring of *unicode*, from character index *start* (included) to
676684
character index *end* (excluded). Negative indices are not supported.
685+
On error, set an exception and return ``NULL``.
677686
678687
.. versionadded:: 3.3
679688

0 commit comments

Comments
 (0)