diff options
Diffstat (limited to 'Lib/_abcoll.py')
-rw-r--r-- | Lib/_abcoll.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index 7890e97..d3e23c1 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py @@ -393,6 +393,10 @@ class MappingView(Sized): class KeysView(MappingView, Set): + @classmethod + def _from_iterable(self, it): + return set(it) + def __contains__(self, key): return key in self._mapping @@ -405,6 +409,10 @@ KeysView.register(dict_keys) class ItemsView(MappingView, Set): + @classmethod + def _from_iterable(self, it): + return set(it) + def __contains__(self, item): key, value = item try: |