DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Python Curry Implementation

08.07.2006
| 4797 views |
  • submit to reddit
        # 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()))