Map with an extra parameter

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Fri Sep 8 20:30:50 EDT 2006


ml1n wrote:
> In the interests of speed my thinking was that using map would move the
> loop out of Python and into C, is that the case when using list
> comprehension?  I'd always thought it was just syntatic short hand for
> a Python loop.

In Python the faster things are often the most simple.
You can time your code to see what's faster.
And even better you may try the simpler solution, and if the program
results too much slow with a profiling you can find the spots needing
improvements.

Bye,
bearophile




More information about the Python-list mailing list