-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
Description
There are two cases where we can add explicit with exception set part. First one is:
Lines 21 to 27 in 9585a1a
| .. c:function:: PyObject* PySlice_New(PyObject *start, PyObject *stop, PyObject *step) | |
| 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 | |
| the new object could not be allocated. |
Notice this part:
Return
NULLif the new object could not be allocated.
And:
Lines 90 to 100 in 9585a1a
| .. c:function:: int PySlice_Unpack(PyObject *slice, Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step) | |
| Extract the start, stop and step data members from a slice object as | |
| C integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to | |
| ``PY_SSIZE_T_MAX``, silently boost the start and stop values less than | |
| ``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. | |
| .. versionadded:: 3.6.1 |
Line 98 in 9585a1a
| Return ``-1`` on error, ``0`` on success. |