mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #28930 -- Simplified code with any() and all().
This commit is contained in:
committed by
Tim Graham
parent
c21f158295
commit
4c599ece57
@@ -87,10 +87,7 @@ class BaseContext:
|
||||
del self.dicts[-1][key]
|
||||
|
||||
def __contains__(self, key):
|
||||
for d in self.dicts:
|
||||
if key in d:
|
||||
return True
|
||||
return False
|
||||
return any(key in d for d in self.dicts)
|
||||
|
||||
def get(self, key, otherwise=None):
|
||||
for d in reversed(self.dicts):
|
||||
|
||||
Reference in New Issue
Block a user