summaryrefslogtreecommitdiffstats
path: root/Lib/_collections_abc.py
diff options
context:
space:
mode:
authorNitish Chandra <nitishchandrachinta@gmail.com>2017-12-12 10:22:30 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-12-12 10:22:30 (GMT)
commit5ce0a2a100909104836f53a2c8823006ec46f8ad (patch)
tree5031cf4b1b64f547bc1b639b34891065180d180e /Lib/_collections_abc.py
parent2001900b0c02a397d8cf1d776a7cc7fcb2a463e3 (diff)
downloadcpython-5ce0a2a100909104836f53a2c8823006ec46f8ad.zip
cpython-5ce0a2a100909104836f53a2c8823006ec46f8ad.tar.gz
cpython-5ce0a2a100909104836f53a2c8823006ec46f8ad.tar.bz2
bpo-31942: Document optional support of start and stop attributes in Sequence.index method (#4277)
Diffstat (limited to 'Lib/_collections_abc.py')
-rw-r--r--Lib/_collections_abc.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_collections_abc.py b/Lib/_collections_abc.py
index e89e84b..a5c7bfc 100644
--- a/Lib/_collections_abc.py
+++ b/Lib/_collections_abc.py
@@ -899,6 +899,9 @@ class Sequence(Reversible, Collection):
def index(self, value, start=0, stop=None):
'''S.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
+
+ Supporting start and stop arguments is optional, but
+ recommended.
'''
if start is not None and start < 0:
start = max(len(self) + start, 0)