NEWBIE: Extending a For Statement.

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Mon May 21 10:02:44 EDT 2007


mosscliffe:
> if key in xrange (60,69) or key == 3:

I keep seeing again and again code like this, mostly from people not
much expert of Python, but the PEP 260 shows the fast in was removed,
so it's O(n). Maybe removing the fast __contains__ was bad for
necomers (or just the casual Python users, that I belive is really
large).

Bye,
bearophile




More information about the Python-list mailing list