[Tim Peters]
>> Or my personal favorite,
>>
>>while mylist:
>>del mylist[::2]
>>
>> Then the original index positions with the most consecutive trailing 1
>> bits survive the longest, which is important to avoid ZODB cache bugs
>> .
[Christos Georgiou]
> This is a joke, hopefully, and in that case, I fell for it. If not, please
> provide a url with related discussion (for educational purposes :)
Fell for what? It's certainly true that the code snippet allows the
original index positions with the most consecutive trailing 1 bits to
survive the longest (on the first iteration, all even index positions
(no trailing 1 bits) are deleted, and you don't really need a URL to
figure out what happens on the i'th iteration). The idea that this is
helpful in avoiding anything's "cache bugs" is purely -worthy,
though.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com