[Python-3000] optimizing [x]range

Lisandro Dalcin dalcinl at gmail.com
Tue Jul 31 20:31:12 CEST 2007


On 7/31/07, Guido van Rossum <guido at python.org> wrote:
> You missed it -- it should definitely be equivalent to
>     4 in list(range(0, 10, 3))
> i.e.
>     4 in [0, 4, 8]

An then, as list/tuple __contains__ is implemented in terms of rich
comparison (with Py_EQ), perhaps a patch is not so easy to be
implemented, at first it do not seems to be as trivial as previously
suggested in this thread.

-- 
Lisandro Dalcín


More information about the Python-3000 mailing list