Kaydet (Commit) b65e5799 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Improve variable names

üst ec4b174d
...@@ -222,14 +222,14 @@ class Condition: ...@@ -222,14 +222,14 @@ class Condition:
def notify(self, n=1): def notify(self, n=1):
if not self._is_owned(): if not self._is_owned():
raise RuntimeError("cannot notify on un-acquired lock") raise RuntimeError("cannot notify on un-acquired lock")
__waiters = self._waiters all_waiters = self._waiters
waiters = _deque(_islice(__waiters, n)) waiters_to_notify = _deque(_islice(all_waiters, n))
if not waiters: if not waiters_to_notify:
return return
for waiter in waiters: for waiter in waiters_to_notify:
waiter.release() waiter.release()
try: try:
__waiters.remove(waiter) all_waiters.remove(waiter)
except ValueError: except ValueError:
pass pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment