mirror of https://github.com/django/django.git
Optimized django.utils.functional.curry. Thanks for the patch, Martin Glueck
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
6152b325aa
commit
29ba3e337b
|
@ -1,6 +1,6 @@
|
|||
def curry(*args, **kwargs):
|
||||
def curry(func, *args, **kwargs):
|
||||
def _curried(*moreargs, **morekwargs):
|
||||
return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))
|
||||
return func(*(args+moreargs), **dict(kwargs, **morekwargs))
|
||||
return _curried
|
||||
|
||||
class Promise:
|
||||
|
|
Loading…
Reference in New Issue