[docs] [issue13502] Documentation for Event.wait return value is either wrong or incomplete
report at bugs.python.org
Tue Nov 29 21:55:54 CET 2011
Antoine Pitrou <pitrou at free.fr> added the comment:
Ok, so digging a bit, the feature dates back to issue1674032.
Interestingly, the OP in that issue had already envisioned that race condition and had precisely proposed the feature to avoid it: “Note that in the above case, the event could be cleared between the return from x.wait and the execution of x.isSet (in another thread), and so this would operate as though x.wait had just timed out”.
So I'm changing my mind and saying it seems desireable to return True if the wait succeeded before the timeout's end, even though the flag may have been reset in the meantime.
In 3.2, Condition.wait also returns a boolean, meaning the check in Event.wait can be atomic.
Python tracker <report at bugs.python.org>
More information about the docs