Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Some code simplification

  • Loading branch information...
commit 40909826172374b849ddc9db8e1a8be9a8c3251b 1 parent aa01c99
@alex alex authored
Showing with 3 additions and 11 deletions.
  1. +3 −11 django/utils/functional.py
View
14 django/utils/functional.py
@@ -258,17 +258,9 @@ def _setup(self):
__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)
Please sign in to comment.
Something went wrong with that request. Please try again.