Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Updates B.index documentation.
  • Loading branch information
lisroach committed Feb 20, 2017
commit 982257f69e8e3c4cda4aaac1fb78563803aaf8bf
7 changes: 5 additions & 2 deletions Objects/bytes_methods.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,11 @@ _Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args)
PyDoc_STRVAR_shared(_Py_index__doc__,
"B.index(sub[, start[, end]]) -> int\n\
\n\
Like B.find() but raise ValueError when the subsection is not found.");
Return the lowest index in B where subsection sub is found,\n\
such that sub is contained within B[start,end]. Optional\n\

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a colon, not a comma: B[start:end]
(I presume these errors were copied from the “find” and “rfind” doc strings; they could also be fixed there, but at least don’t repeat the errors)

arguments start and end are interpreted as in slice notation.\n\
\n\
Raises ValueError when the subsection is not found.");

PyObject *
_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args)
Expand Down Expand Up @@ -811,4 +815,3 @@ PyDoc_STRVAR_shared(_Py_zfill__doc__,
"\n"
"Pad a numeric string B with zeros on the left, to fill a field\n"
"of the specified width. B is never truncated.");