diff options
| author | Nick Bruun <nick@bruun.co> | 2013-08-18 15:58:55 +0200 |
|---|---|---|
| committer | Nick Bruun <nick@bruun.co> | 2013-08-18 15:58:55 +0200 |
| commit | 7a698c05b56d7d5e267241dc71c16c403efd2965 (patch) | |
| tree | b78c659a90372eb5c597b893aad779d0174e0309 | |
| parent | b9ef96e73cf2f2613eb6ca96038ef8c4271ac116 (diff) | |
Update LazyObject method proxy declarations to simpler form.
| -rw-r--r-- | django/utils/functional.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/django/utils/functional.py b/django/utils/functional.py index 465de283e5..7336572b35 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -270,13 +270,8 @@ class LazyObject(object): def __delitem__(self, key): del self[key] - @new_method_proxy - def __len__(self): - return len(self) - - @new_method_proxy - def __contains__(self, key): - return key in self + __len__ = new_method_proxy(len) + __contains__ = new_method_proxy(operator.contains) # Workaround for http://bugs.python.org/issue12370 |
