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

Method __iter__

Lib/_weakrefset.py:24–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22 self.update(data)
23
24 def __iter__(self):
25 for itemref in self.data.copy():
26 item = itemref()
27 if item is not None:
28 # Caveat: the iterator will keep a strong reference to
29 # `item` until it is resumed or closed.
30 yield item
31
32 def __len__(self):
33 return len(self.data)

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected