diff options
Diffstat (limited to 'Lib/collections')
-rw-r--r-- | Lib/collections/__init__.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index aab5aee..922bba2 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -679,6 +679,9 @@ class ChainMap(MutableMapping): def __contains__(self, key): return any(key in m for m in self.maps) + def __bool__(self): + return any(self.maps) + @_recursive_repr() def __repr__(self): return '{0.__class__.__name__}({1})'.format( |