Author veky
Recipients docs@python, veky
Date 2016-09-18.20:50:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Look at this:

    >>> from import Sequence

    >>> help(Sequence.index)
    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.

    >>> issubclass(range, Sequence)

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

So far, so good. But:

    >>> range(9).index(2, 1, 5)
    TypeError: index() takes exactly one argument (3 given)

Of course it's not essential, but the docs shouldn't lie. And if range _is_ a Sequence, then it should have the complete interface of a Sequence. Including start and end arguments for .index: they are optional from the point of call, not from the point of implementation. :-)
Date User Action Args
2016-09-18 20:50:32vekysetrecipients: + veky, docs@python
2016-09-18 20:50:32vekysetmessageid: <>
2016-09-18 20:50:32vekylinkissue28197 messages
2016-09-18 20:50:32vekycreate