my favorite line of py code so far

Peter Cacioppi peter.cacioppi at gmail.com
Fri Nov 8 17:22:24 EST 2013


my fav so far is this

_ = lambda c : lambda x : c(*x)

c can be any calleable and x any iterable, but I tend to use it with a class, and then map _(class) over the result of a zip.

It must be in the library somewhere, but I haven't found it. I'm never sure what to call it, so I just reroll it into _ as needed. It's pretty easy for me to remember, but I'll probably tattoo it on my chest just in case.









More information about the Python-list mailing list