summaryrefslogtreecommitdiff
path: root/django/utils/functional.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils/functional.py')
-rw-r--r--django/utils/functional.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index 734704f6f3..f4580e7bd5 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -101,6 +101,13 @@ def lazy(func, *resultclasses):
else:
raise AssertionError('__mod__ not supported for non-string types')
+ def __deepcopy__(self, memo):
+ # 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.
return __proxy__(args, kw)