When Python outruns C++ ...

Jack Diederich jack at performancedrivers.com
Wed Apr 2 19:17:41 EST 2003


On Thu, Apr 03, 2003 at 12:07:14AM +0100, Robin Becker wrote:
> Interestingly attempts to get an integer for loop (without range/xrange)
> are met with extreme disapproval by the language gurus and the fastest
> looping constructs of all map, filter et al are considered bad form.

I prefer map and filter all the time, but they aren't always the fastest.
List comps are faster for simple tasks and if you need both the IN list
and the NOT IN list, using a for loop is faster than two filters (unsuprisngly)

-jackdied





More information about the Python-list mailing list