(self, value=1)
| 427 | # After Tim Peters' semaphore class, but not quite the same (no maximum) |
| 428 | |
| 429 | def __init__(self, value=1): |
| 430 | if value < 0: |
| 431 | raise ValueError("semaphore initial value must be >= 0") |
| 432 | self._cond = Condition(Lock()) |
| 433 | self._value = value |
| 434 | |
| 435 | def __repr__(self): |
| 436 | cls = self.__class__ |