summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMax Bachmann <kontakt@maxbachmann.de>2024-09-27 10:35:55 (GMT)
committerGitHub <noreply@github.com>2024-09-27 10:35:55 (GMT)
commitb79a21ea429844e84509430e636d808ea9cff244 (patch)
tree52311ae4d2715726d8e56c52f591791d40aa42f2 /Doc
parent5329d1b74a86b3a22ff36f7976bfe720ee06d10d (diff)
downloadcpython-b79a21ea429844e84509430e636d808ea9cff244.zip
cpython-b79a21ea429844e84509430e636d808ea9cff244.tar.gz
cpython-b79a21ea429844e84509430e636d808ea9cff244.tar.bz2
GH-95079: document error behaviour for some unicode C APIs (#95080)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/unicode.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/unicode.rst b/Doc/c-api/unicode.rst
index 30e26fe..646c1b0 100644
--- a/Doc/c-api/unicode.rst
+++ b/Doc/c-api/unicode.rst
@@ -338,6 +338,8 @@ APIs:
This is the recommended way to allocate a new Unicode object. Objects
created using this function are not resizable.
+ On error, set an exception and return ``NULL``.
+
.. versionadded:: 3.3
@@ -614,6 +616,8 @@ APIs:
Return the length of the Unicode object, in code points.
+ On error, set an exception and return ``-1``.
+
.. versionadded:: 3.3
@@ -657,6 +661,8 @@ APIs:
not out of bounds, and that the object can be modified safely (i.e. that it
its reference count is one).
+ Return ``0`` on success, ``-1`` on error with an exception set.
+
.. versionadded:: 3.3
@@ -666,6 +672,8 @@ APIs:
Unicode object and the index is not out of bounds, in contrast to
:c:func:`PyUnicode_READ_CHAR`, which performs no error checking.
+ Return character on success, ``-1`` on error with an exception set.
+
.. versionadded:: 3.3
@@ -674,6 +682,7 @@ APIs:
Return a substring of *unicode*, from character index *start* (included) to
character index *end* (excluded). Negative indices are not supported.
+ On error, set an exception and return ``NULL``.
.. versionadded:: 3.3