MCPcopy Index your code
hub / github.com/python/cpython / ItemsView

Class ItemsView

Lib/_collections_abc.py:865–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 6

test_same_as_reprMethod · 0.90
test_basic_line_wrapMethod · 0.90
test_abc_viewsMethod · 0.90
test_issue26915Method · 0.90
itemsMethod · 0.85

Calls

no outgoing calls

Tested by 5

test_same_as_reprMethod · 0.72
test_basic_line_wrapMethod · 0.72
test_abc_viewsMethod · 0.72
test_issue26915Method · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…