@@ -853,12 +853,23 @@ The following functions are used to create and modify Unicode exceptions from C.
853853 *\* start *. *start * must not be ``NULL ``. Return ``0 `` on success, ``-1 `` on
854854 failure.
855855
856+ If the :attr: `UnicodeError.object ` is an empty sequence, the resulting
857+ *start * is ``0 ``. Otherwise, it is clipped to ``[0, len(object) - 1] ``.
858+
859+ .. seealso :: :attr:`UnicodeError.start`
860+
856861.. c :function :: int PyUnicodeDecodeError_SetStart (PyObject *exc, Py_ssize_t start)
857862 int PyUnicodeEncodeError_SetStart(PyObject *exc, Py_ssize_t start)
858863 int PyUnicodeTranslateError_SetStart(PyObject *exc, Py_ssize_t start)
859864
860- Set the *start * attribute of the given exception object to *start *. Return
861- ``0 `` on success, ``-1 `` on failure.
865+ Set the *start * attribute of the given exception object to *start *.
866+ Return ``0 `` on success, ``-1 `` on failure.
867+
868+ .. note ::
869+
870+ While passing a negative *start * does not raise an exception,
871+ the corresponding getters will not consider it as a relative
872+ offset.
862873
863874.. c :function :: int PyUnicodeDecodeError_GetEnd (PyObject *exc, Py_ssize_t *end)
864875 int PyUnicodeEncodeError_GetEnd(PyObject *exc, Py_ssize_t *end)
@@ -868,13 +879,18 @@ The following functions are used to create and modify Unicode exceptions from C.
868879 *\* end *. *end * must not be ``NULL ``. Return ``0 `` on success, ``-1 `` on
869880 failure.
870881
882+ If the :attr: `UnicodeError.object ` is an empty sequence, the resulting
883+ *end * is ``0 ``. Otherwise, it is clipped to ``[1, len(object)] ``.
884+
871885.. c :function :: int PyUnicodeDecodeError_SetEnd (PyObject *exc, Py_ssize_t end)
872886 int PyUnicodeEncodeError_SetEnd(PyObject *exc, Py_ssize_t end)
873887 int PyUnicodeTranslateError_SetEnd(PyObject *exc, Py_ssize_t end)
874888
875889 Set the *end * attribute of the given exception object to *end *. Return ``0 ``
876890 on success, ``-1 `` on failure.
877891
892+ .. seealso :: :attr:`UnicodeError.end`
893+
878894.. c :function :: PyObject* PyUnicodeDecodeError_GetReason (PyObject *exc)
879895 PyObject * PyUnicodeEncodeError_GetReason(PyObject *exc)
880896 PyObject * PyUnicodeTranslateError_GetReason(PyObject *exc)
0 commit comments