8000 [3.12] gh-121567: Improve `slice` C-API docs by mentioning exceptions (GH-121568) by miss-islington · Pull Request #121579 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.12] gh-121567: Improve slice C-API docs by mentioning exceptions (GH-121568) #121579

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
Jul 10, 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
8000
Diff view
8 changes: 5 additions & 3 deletions Doc/c-api/slice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ Slice Objects
Return a new slice object with the given values. The *start*, *stop*, and
*step* parameters are used as the values of the slice object attributes of
the same names. Any of the values may be ``NULL``, in which case the
``None`` will be used for the corresponding attribute. Return ``NULL`` if
``None`` will be used for the corresponding attribute.

Return ``NULL`` with an exception set if
the new object could not be allocated.


Expand Down Expand Up @@ -52,7 +54,7 @@ Slice Objects
of bounds indices are clipped in a manner consistent with the handling of
normal slices.

Returns ``0`` on success and ``-1`` on error with exception set.
Return ``0`` on success and ``-1`` on error with an exception set.

.. note::
This function is considered not safe for resizable sequences.
Expand Down Expand Up @@ -95,7 +97,7 @@ Slice Objects
``PY_SSIZE_T_MIN`` to ``PY_SSIZE_T_MIN``, and silently boost the step
values less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``.

Return ``-1`` on error, ``0`` on success.
Return ``-1`` with an exception set on error, ``0`` on success.

.. versionadded:: 3.6.1

Expand Down
Loading
0