This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients Jason.Baker, rhettinger
Date 2011-01-25.23:08:01
SpamBayes Score 0.015432175
Marked as misclassified No
Message-id <1295996883.08.0.707332584388.issue11011@psf.upfronthosting.co.za>
In-reply-to
Content
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]
History
Date User Action Args
2011-01-25 23:08:03rhettingersetrecipients: + rhettinger, Jason.Baker
2011-01-25 23:08:03rhettingersetmessageid: <1295996883.08.0.707332584388.issue11011@psf.upfronthosting.co.za>
2011-01-25 23:08:01rhettingerlinkissue11011 messages
2011-01-25 23:08:01rhettingercreate