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

Method __init__

Lib/threading.py:464–468  ·  view source on GitHub ↗
(self, value=1)

Source from the content-addressed store, hash-verified

462 # After Tim Peters' semaphore class, but not quite the same (no maximum)
463
464 def __init__(self, value=1):
465 if value < 0:
466 raise ValueError("semaphore initial value must be >= 0")
467 self._cond = Condition(Lock())
468 self._value = value
469
470 def __repr__(self):
471 cls = self.__class__

Callers

nothing calls this directly

Calls 2

ConditionClass · 0.70
LockClass · 0.50

Tested by

no test coverage detected