From 40909826172374b849ddc9db8e1a8be9a8c3251b Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sun, 18 Aug 2013 09:43:41 -0700 Subject: [PATCH] Some code simplification --- django/utils/functional.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/django/utils/functional.py b/django/utils/functional.py index 7336572b35..fd10a84b26 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -258,17 +258,9 @@ class LazyObject(object): __dir__ = new_method_proxy(dir) # Dictionary methods support - @new_method_proxy - def __getitem__(self, key): - return self[key] - - @new_method_proxy - def __setitem__(self, key, value): - self[key] = value - - @new_method_proxy - def __delitem__(self, key): - del self[key] + __getitem__ = new_method_proxy(operator.getitem) + __setitem__ = new_method_proxy(operator.setitem) + __delitem__ = new_method_proxy(operator.delitem) __len__ = new_method_proxy(len) __contains__ = new_method_proxy(operator.contains)