summaryrefslogtreecommitdiff
path: root/django/utils/functional.py
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-08-19 18:30:48 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-08-19 18:30:48 +0100
commitb6a957f0ba8a2ed1b24d7ee042a9c4beaf51ab03 (patch)
tree87d42b9e8d3d4c1516b53eee1d9332735762826a /django/utils/functional.py
parent52edc16086e3c28a78c31975bb4da2f9450590b4 (diff)
parent3c0300405009b82b52fd15483371097221662fcd (diff)
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts: docs/ref/django-admin.txt
Diffstat (limited to 'django/utils/functional.py')
-rw-r--r--django/utils/functional.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py
index e23bd3ff80..9cc703fe84 100644
--- a/django/utils/functional.py
+++ b/django/utils/functional.py
@@ -263,17 +263,12 @@ class LazyObject(object):
__dir__ = new_method_proxy(dir)
# Dictionary methods support
- @new_method_proxy
- def __getitem__(self, key):
- return self[key]
+ __getitem__ = new_method_proxy(operator.getitem)
+ __setitem__ = new_method_proxy(operator.setitem)
+ __delitem__ = new_method_proxy(operator.delitem)
- @new_method_proxy
- def __setitem__(self, key, value):
- self[key] = value
-
- @new_method_proxy
- def __delitem__(self, key):
- del self[key]
+ __len__ = new_method_proxy(len)
+ __contains__ = new_method_proxy(operator.contains)
# Workaround for http://bugs.python.org/issue12370