summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-15 11:13:21 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-09-15 11:13:21 +0000
commit09060e9bc8377303f16a7226189e28b915313dc2 (patch)
treee83ee146cc241bb9bd995f4cc9de6f799ec246f2
parentb361947745971eac1f875271cf084c0516496264 (diff)
Made a small optimization to __deepcopy__ in [6276].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6279 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--django/utils/functional.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 72a66917fc..f4580e7bd5 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.