> Yeeh, I was expecting something like that. The only reason to use
> map() at all is for improving the performance.
> That is lost when using list comprehensions (as far as I know). So,
> this is *no* option for larger jobs.
Try it and see. You'll probably be pleasantly surprised.
Note that you can use `str.upper` in map ...
/usr/bin> C:/Python24/python.exe -m timeit -s "strings = ['a']*1000"
"map(str.upper, strings)"
1000 loops, best of 3: 304 usec per loop
/usr/bin> C:/Python24/python.exe -m timeit -s "strings = ['a']*1000"
"[s.upper() for s in strings]"
1000 loops, best of 3: 331 usec per loop
Re: Can I overload the compare (cmp()) function for a Lists ([]) index function? ... 100000 loops, best of 3: 5.05 usec per loop ... Functions like filter() and mapare really only more efficient when you have an existing C-coded function, like ``map``. ... Of course, if the filtercode is clearer to you, feel free to use it, but I find that most folks find list comprehensions easier to read than map() and filtercode. ... (comp.lang.python)
Re: Using java.util.map ... You perform a lookup and an insertion. ... these operations degenerate each element in the map would have been visited. ... create an extra pairobject for each entry), and the Java way is dirty. ... problems understanding simple for loops of the sort ... (comp.lang.java.advocacy)
Re: string goes away ... I read in an guidline for improving Python's performance that you should prefer map() compared to list comprehensions.... 100000 loops, best of 3: 9.24 usec per loop ... (comp.lang.python)
Re: RR: Adams Gulch, Idaho ... > Ketchum, ID ... After checking with the LBS and asking for ... > good loops, we map out our route, not realizing that there may have been ... (alt.mountain-bike)
Re: Optimizing multiple dispatch ... > I've asked for optimization advice a few times here, ... I wonder where people get this idea that map... 1000 loops, best of 3: 230 usec per loop ... (comp.lang.python)