This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davidfraser
Recipients
Date 2007-03-05.13:33:33
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Currently the wait method on threading.Event always returns None, even if a timeout is given and the event is not set.
This means that there is no way to determine whether the wait method returned because the event was set, or because the timeout period expired, without querying the event status again:

x.wait(3)
if x.isSet():
  # do stuff

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

It would be great to be able to do:

if x.wait(3):
  # do stuff

This should also not affect any existing code as it shouldn't be relying on the return value from x.wait anyway
History
Date User Action Args
2007-08-23 16:12:39adminlinkissue1674032 messages
2007-08-23 16:12:39admincreate