[New-bugs-announce] [issue34848] range.index only takes one argument when it's documented as taking the usual 3

Dan Snider report at bugs.python.org
Sat Sep 29 23:55:38 EDT 2018


New submission from Dan Snider <mr.assume.away at gmail.com>:

Unfortunately, it looks like there's no requirement for an abc.Sequence to implement the 3 argument form of seq.index, so I suppose this is technically just a documentation bug...

>>> range(5).index(2, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: index() takes exactly one argument (2 given)

>>> help(range.index)
Help on method_descriptor:

index(...)
    rangeobject.index(value, [start, [stop]]) -> integer -- return index of value.
    Raise ValueError if the value is not present.

----------
assignee: docs at python
components: Argument Clinic, Documentation
messages: 326701
nosy: bup, docs at python, larry
priority: normal
severity: normal
status: open
title: range.index only takes one argument when it's documented as taking the usual 3
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34848>
_______________________________________


More information about the New-bugs-announce mailing list