Skip to content

[3.12] GH-95079: document error behaviour for some unicode C APIs (GH-95080) #124662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,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


Expand Down Expand Up @@ -598,6 +600,8 @@ APIs:

Return the length of the Unicode object, in code points.

On error, set an exception and return ``-1``.

.. versionadded:: 3.3


Expand Down Expand Up @@ -641,6 +645,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


Expand All @@ -650,6 +656,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


Expand All @@ -658,6 +666,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

Expand Down
Loading