https://github.com/python/cpython/commit/8c4728f6af5b768f04aeb019a88de8e4aef0afc8
commit: 8c4728f6af5b768f04aeb019a88de8e4aef0afc8
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-07-10T11:13:40Z
summary:

[3.13] gh-121567: Improve `slice` C-API docs by mentioning exceptions 
(GH-121568) (#121578)

gh-121567: Improve `slice` C-API docs by mentioning exceptions (GH-121568)
(cherry picked from commit 84a5597b08b7d53aced2fbd0048271ce762807a8)

Co-authored-by: sobolevn <[email protected]>
Co-authored-by: Erlend E. Aasland <[email protected]>

files:
M Doc/c-api/slice.rst

diff --git a/Doc/c-api/slice.rst b/Doc/c-api/slice.rst
index 27a1757c745d8b..8adf6a961378a3 100644
--- a/Doc/c-api/slice.rst
+++ b/Doc/c-api/slice.rst
@@ -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.
 
 
@@ -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.
@@ -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
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to