MCPcopy Index your code
hub / github.com/RustPython/RustPython / ItemsView

Class ItemsView

Lib/_collections_abc.py:864–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

862
863
864class ItemsView(MappingView, Set):
865
866 __slots__ = ()
867
868 @classmethod
869 def _from_iterable(cls, it):
870 return set(it)
871
872 def __contains__(self, item):
873 key, value = item
874 try:
875 v = self._mapping[key]
876 except KeyError:
877 return False
878 else:
879 return v is value or v == value
880
881 def __iter__(self):
882 for key in self._mapping:
883 yield (key, self._mapping[key])
884
885
886ItemsView.register(dict_items)

Callers 2

test_issue26915Method · 0.90
itemsMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_issue26915Method · 0.72