bpo-34848 : Correct a method signature in docstring for range(..).index method by srinivasreddy · Pull Request #9877 · python/cpython (original) (raw)
>>> range(100).index(2,0,10)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: index() takes exactly one argument (3 given)
>>> range(100).index(2,0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: index() takes exactly one argument (2 given)
>>> range(100).index(2)
2
>>> range(100).index(100)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: 100 is not in range
>>> range(100).index(99)
99