Raymond Hettinger added the comment:

Try something like this:

        if start < 0:
            start += len(self)
        if stop is None:
            stop = len(self)
        elif stop < 0:
            stop += len(self)
        for i in range(max(start, 0), min(stop, len(self))):
            if self[i] == value:
                return i
        raise ValueError

----------

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

Reply via email to