bpo-31942: Document optional support of start and stop attributes in Sequence.index method#4277
Conversation
|
@serhiy-storchaka: Would you mind to review this PR, since you worked on that topic and created https://bugs.python.org/issue31942 ? |
| Raises ValueError if the value is not present. | ||
|
|
||
| It is not required that all concrete implementations of | ||
| the Sequence class support start and stop attributes. |
There was a problem hiding this comment.
I would rephrase it as:
Supporting start and stop optional arguments is optional, but recommended.
There was a problem hiding this comment.
I changed it to 'Supporting start and stop arguments is optional, but recommended.". I removed the first 'optional' word because the senses of both 'optional' words is different and might confuse the reader and also the sense of first 'optional' is conveyed by the function signature anyway.
| without copying any data and with the returned index being relative to | ||
| the start of the sequence rather than the start of the slice. | ||
| Not all implementations support passing the additional arguments *i* and *j*. | ||
| When supported, these arguments allow efficient searching of |
There was a problem hiding this comment.
"Not all implementations support passing the additional arguments i and j." seems redundant with "When supported".
| the start of the sequence rather than the start of the slice. | ||
| Not all implementations support passing the additional arguments | ||
| *i* and *j*. These arguments allow efficient searching of | ||
| subsections of the sequence. Passing the extra arguments is roughly |
There was a problem hiding this comment.
Avoid reflowing the lines that are not changed.
There was a problem hiding this comment.
Minimised the reflowing.
|
|
||
| Supporting start and stop arguments is optional, but | ||
| recommended. | ||
|
|
…Sequence.index method (pythonGH-4277) (cherry picked from commit 5ce0a2a)
|
GH-4811 is a backport of this pull request to the 3.6 branch. |
I changed the method docstring and also the html documentation to say that not all implementations are required to support start and stop attributes. Is a NEWS entry required for this?
Bug: https://bugs.python.org/issue31942
https://bugs.python.org/issue31942