Issue #9214: Fix set operations on KeysView and ItemsView.
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py
index a442d7c..e9234af 100644
--- a/Lib/_abcoll.py
+++ b/Lib/_abcoll.py
@@ -390,6 +390,10 @@
class KeysView(MappingView, Set):
+ @classmethod
+ def _from_iterable(self, it):
+ return set(it)
+
def __contains__(self, key):
return key in self._mapping
@@ -400,6 +404,10 @@
class ItemsView(MappingView, Set):
+ @classmethod
+ def _from_iterable(self, it):
+ return set(it)
+
def __contains__(self, item):
key, value = item
try: