@@ -546,7 +546,11 @@ _Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args)
546
546
PyDoc_STRVAR_shared (_Py_index__doc__ ,
547
547
"B.index(sub[, start[, end]]) -> int\n\
548
548
\n\
549
- Like B.find() but raise ValueError when the subsection is not found." );
549
+ Return the lowest index in B where subsection sub is found,\n\
550
+ such that sub is contained within B[start,end]. Optional\n\
551
+ arguments start and end are interpreted as in slice notation.\n\
552
+ \n\
553
+ Raises ValueError when the subsection is not found." );
550
554
551
555
PyObject *
552
556
_Py_bytes_index (const char * str , Py_ssize_t len , PyObject * args )
@@ -583,7 +587,11 @@ _Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args)
583
587
PyDoc_STRVAR_shared (_Py_rindex__doc__ ,
584
588
"B.rindex(sub[, start[, end]]) -> int\n\
585
589
\n\
586
- Like B.rfind() but raise ValueError when the subsection is not found." );
590
+ Return the highest index in B where subsection sub is found,\n\
591
+ such that sub is contained within B[start,end]. Optional\n\
592
+ arguments start and end are interpreted as in slice notation.\n\
593
+ \n\
594
+ Raise ValueError when the subsection is not found." );
587
595
588
596
PyObject *
589
597
_Py_bytes_rindex (const char * str , Py_ssize_t len , PyObject * args )
@@ -815,4 +823,3 @@ PyDoc_STRVAR_shared(_Py_zfill__doc__,
815
823
"\n"
816
824
"Pad a numeric string B with zeros on the left, to fill a field\n"
817
825
"of the specified width. B is never truncated." );
818
-
0 commit comments