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

Class Counter

Lib/test/test_threading.py:68–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67# A trivial mutable counter.
68class Counter(object):
69 def __init__(self):
70 self.value = 0
71 def inc(self):
72 self.value += 1
73 def dec(self):
74 self.value -= 1
75 def get(self):
76 return self.value
77
78class TestThread(threading.Thread):
79 def __init__(self, name, testcase, sema, mutex, nrunning):

Callers 1

test_various_opsMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_various_opsMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…