Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Python Curry Implementation

DZone's Guide to

Python Curry Implementation

·
Free Resource
# Generalized version of curry, works w/ keywords too...  snarfed original version
# from somewhere else ages ago, much simpler / cleaner than other implementations


curry = lambda func, *args, **kw:\
            lambda *p, **n:\
                 func(*args + p, **dict(kw.items() + n.items()))
Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}