也许,更像 Haskell (zipWith)
from itertools import izip, starmap, repeat
a, b, c, d = starmap(max, izip(repeat(0.2), (0.03, 0.4, 0.055, 0.7)))
一些基本的timeits(darwin 12.2.0,py 2.7.3):
In [0]: %timeit a,b,c,d = starmap(max, izip(repeat(0.2), (0.03, 0.4, 0.055, 0.7)))
1000000 loops, best of 3: 1.87 us per loop
In [1]: %timeit a,b,c,d = map(max, izip(repeat(0.2), (0.03, 0.4, 0.055, 0.7)))
100000 loops, best of 3: 3.99 us per loop
In [2]: %timeit a,b,c,d = [max(0.2, v) for v in [0.03,0.4,0.055,0.7]]
100000 loops, best of 3: 1.95 us per loop
In [3]: %timeit a,b,c,d = [max(0.2, v) for v in (0.03,0.4,0.055,0.7)]
1000000 loops, best of 3: 1.62 us per loop
结论: