[EMAIL PROTECTED] wrote:
> Given that I find the cascading comparisons clearer I see no reason
> to optimize the "in range(...)" case.
The sort of thing I have in mind is where I have a sequence
that I want to frequently iterate over the indices of, so
I do
r = xrange(len(myseq))
so I can write
for i in r:
...
Having done that, if I want to test whether some index j
is within the range of indices for this sequence, it
seems natural to write
if j in r:
...
Given the context, I think this is a very Obvious Way To
Do It, and it's surprising that it isn't as efficient as it
looks like it should be.
--
Greg
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com