Deleting from a list while iterating

Fredrik Lundh fredrik at pythonware.com
Sun Dec 3 11:02:34 EST 2006


Fredrik Lundh wrote:

> on my machine, that's about two orders of magnitude faster than your 
> "fast" approach for n=100000.

oops.  forget that; it's three times faster, if you're actually creating 
the entire list, and not just a generator that will create it on demand ;-)

</F>




More information about the Python-list mailing list