This post originated from an RSS feed registered with Python Buzz
by Hans Nowak.
Original Post: Not safe for work
Feed Title: Efectos Especiales
Feed URL: http://www.zephyrfalcon.org/weblog2/rss.xml
Feed Description: Ramblings, rants, musings, ideas and observations. Topics include (but are not limited to): programming (especially Python), books, games (especially CCGs and board games), astrology, design, writing, painting, etc.
Upon reading PEP 309, I saw the implementations of the curry class/function. Note that curry can be written as a one-liner: curry = lambda f, *args, **kwargs: lambda *cargs, **ckwargs: \ f(*(args+cargs), **dict(kwargs.items() + ckwargs.items())) def bar(x, y, z=42): return x*3 + y*2 + z b = curry(bar, 1) print b(2, z=3) It's not very readable, of course, and it has no practical use. ... [91 words]