Message127067
One other thought: The use of list comprehensions (a.k.a. list displays) and generator expressions has made many functional tools less necessary than ever.
# preferred over map(pow, repeat(2), range(5))
[pow(2, x) for x in range(5)]
# preferred over map(flip, dict.items())
[(v, k) for k, v in mydict.items()]
The list comprehension and genexp styles are much more flexible and works well with default arguments, constants, and using a combination of features:
# hard to do with functionals
[f(g(2,x), h(x, 3, y, flag=True)) for x, y in zip(X, Y) if x>y//2] |
|
Date |
User |
Action |
Args |
2011-01-25 23:08:03 | rhettinger | set | recipients:
+ rhettinger, Jason.Baker |
2011-01-25 23:08:03 | rhettinger | set | messageid: <1295996883.08.0.707332584388.issue11011@psf.upfronthosting.co.za> |
2011-01-25 23:08:01 | rhettinger | link | issue11011 messages |
2011-01-25 23:08:01 | rhettinger | create | |
|