List comprehensions performance

Skip Montanaro skip at pobox.com
Wed Sep 29 19:27:21 EDT 2004


    Neuruss> What I'd like to know is if using list comprehensions would
    Neuruss> give me a performance advantage over traditional for loops or
    Neuruss> not.

You can always run tests to see. <wink>  There is some data dependency so it
makes sense to test map, listcomps and for loops using data that's typical
of the application you intend to use them in.

Skip



More information about the Python-list mailing list