From 09060e9bc8377303f16a7226189e28b915313dc2 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Sat, 15 Sep 2007 11:13:21 +0000 Subject: [PATCH] Made a small optimization to __deepcopy__ in [6276]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6279 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/utils/functional.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/django/utils/functional.py b/django/utils/functional.py index 72a66917fc8..f4580e7bd51 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -1,5 +1,3 @@ -import copy - def curry(_curried_func, *args, **kwargs): def _curried(*moreargs, **morekwargs): return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) @@ -104,9 +102,11 @@ def lazy(func, *resultclasses): raise AssertionError('__mod__ not supported for non-string types') def __deepcopy__(self, memo): - result = copy.copy(self) - memo[id(self)] = result - return result + # Instances of this class are effectively immutable. It's just a + # collection of functions. So we don't need to do anything + # complicated for copying. + memo[id(self)] = self + return self def __wrapper__(*args, **kw): # Creates the proxy object, instead of the actual value.