Closed
Description
range.index()
does not accept start
and stop
arguments (the documentation was fixed in python/cpython#13075):
>>> range(1, 9).index(1, 0, 1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: index() takes exactly one argument (3 given)
The stub file indicates that 3 arguments can be given. However, removing these extra arguments makes mypy complain about the signature of index
being incompatible with supertype Sequence
.
typeshed/stdlib/2and3/builtins.pyi
Line 1093 in ce42c16
Line 278 in ce42c16