From 29ba3e337bd9c95d059eeae55a3743b675c21150 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Thu, 7 Sep 2006 04:21:11 +0000 Subject: [PATCH] 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 --- django/utils/functional.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/utils/functional.py b/django/utils/functional.py index d1514d5728..2c13c90bbb 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -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: