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

Class MutatingCompare

Lib/test/test_deque.py:114–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 d = deque([1, 2, 3])
113 self.assertRaises(ArithmeticError, d.count, BadCompare())
114 class MutatingCompare:
115 def __eq__(self, other):
116 self.d.pop()
117 return True
118 m = MutatingCompare()
119 d = deque([1, 2, 3, m, 4, 5])
120 m.d = d

Callers 1

test_countMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_countMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…