New submission from Kaleb Barrett <dev.ktbarr...@gmail.com>:

The range builtin type is a collections.abc.Sequence, which in Python 3.5 added 
the optional start and stop arguments to the index method of Sequences. 
However, range.index does not support these optional arguments required by 
Sequence.

I noticed this when creating a wrapper type around range which was a  Sequence. 
mypy complained 'Signature of "index" incompatible with supertype "Sequence"', 
but attempting to pass the values raised 'TypeError: index() takes exactly one 
argument (3 given)'.

----------
components: Library (Lib)
messages: 391029
nosy: ktbarrett
priority: normal
severity: normal
status: open
title: range.index doesn't support start/stop optional arguments
type: behavior
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43836>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to