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

Class CounterSubclassWithGet

Lib/test/test_collections.py:2067–2074  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2065 Counter.__setitem__(self, key, value)
2066
2067class CounterSubclassWithGet(Counter):
2068 # Test a counter subclass that overrides get()
2069 def __init__(self, *args, **kwds):
2070 self.called = False
2071 Counter.__init__(self, *args, **kwds)
2072 def get(self, key, default):
2073 self.called = True
2074 return Counter.get(self, key, default)
2075
2076class TestCounter(unittest.TestCase):
2077

Callers 1

test_helper_functionMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_helper_functionMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…