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

Class CustomStr

Lib/test/test_iter.py:264–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262 it = iter(item) if sentinel is None else iter(item, sentinel)
263
264 class CustomStr:
265 def __init__(self, name, iterator):
266 self.name = name
267 self.iterator = iterator
268 def __hash__(self):
269 return hash(self.name)
270 def __eq__(self, other):
271 # Here we exhaust our iterator, possibly changing
272 # its `it_seq` pointer to NULL
273 # The `__reduce__` call should correctly get
274 # the pointers after this call
275 list(self.iterator)
276 return other == self.name
277
278 # del is required here
279 # to not prematurely call __eq__ from

Callers 1

runMethod · 0.70

Calls

no outgoing calls

Tested by 1

runMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…