8000 gh-121567: Improve `slice` C-API docs by mentioning exceptions (#121568) · python/cpython@84a5597 · GitHub
[go: up one dir, main page]

Skip to content

Commit 84a5597

Browse files
gh-121567: Improve slice C-API docs by mentioning exceptions (#121568)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
1 parent cced22c commit 84a5597

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/c-api/slice.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ Slice Objects
2323
Return a new slice object with the given values. The *start*, *stop*, and
2424
*step* parameters are used as the values of the slice object attributes of
2525
the same names. Any of the values may be ``NULL``, in which case the
26-
``None`` will be used for the corresponding attribute. Return ``NULL`` if
26+
``None`` will be used for the corresponding attribute.
27+
28+
Return ``NULL`` with an exception set if
2729
the new object could not be allocated.
2830
2931
@@ -52,7 +54,7 @@ Slice Objects
5254
of bounds indices are clipped in a manner consistent with the handling of
5355
normal slices.
5456
55-
Returns ``0`` on success and ``-1`` on error with exception set.
57+
Return ``0`` on success and ``-1`` on error with an exception set.
5658
5759
.. note::
5860
This function is considered not safe for resizable sequences.
@@ -95,7 +97,7 @@ Slice Objects
9597
``PY_SSIZE_T_MIN`` to ``PY_SSIZE_T_MIN``, and silently boost the step
9698
values less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``.
9799
98-
Return ``-1`` on error, ``0`` on success.
100+
Return ``-1`` with an exception set on error, ``0`` on success.
99101
100102
.. versionadded:: 3.6.1
101103

0 commit comments

Comments
 (0)
0