Add pydocstyle to the ruff rules (#52136)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Signed-off-by: Harry Mellor <hej.mellor@gmail.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -19,10 +19,10 @@ class Counter:
|
||||
|
||||
|
||||
class AtomicCounter:
|
||||
"""An atomic, thread-safe counter"""
|
||||
"""An atomic, thread-safe counter."""
|
||||
|
||||
def __init__(self, initial: int = 0) -> None:
|
||||
"""Initialize a new atomic counter to given initial value"""
|
||||
"""Initialize a new atomic counter to given initial value."""
|
||||
super().__init__()
|
||||
|
||||
self._value = initial
|
||||
@@ -33,13 +33,13 @@ class AtomicCounter:
|
||||
return self._value
|
||||
|
||||
def inc(self, num: int = 1) -> int:
|
||||
"""Atomically increment the counter by num and return the new value"""
|
||||
"""Atomically increment the counter by num and return the new value."""
|
||||
with self._lock:
|
||||
self._value += num
|
||||
return self._value
|
||||
|
||||
def dec(self, num: int = 1) -> int:
|
||||
"""Atomically decrement the counter by num and return the new value"""
|
||||
"""Atomically decrement the counter by num and return the new value."""
|
||||
with self._lock:
|
||||
self._value -= num
|
||||
return self._value
|
||||
|
||||
Reference in New Issue
Block a user