Jeffrey Yasskin <jyass...@gmail.com> added the comment:

* This method will confuse some people who will think that cond.wait(pred) will 
wake up when pred becomes true regardless of whether they call 
cond.notifyAll(). You should warn them about this in the documentation. (This 
confusion happens inside Google, despite our documentation, but the method's 
worth having even though not everyone will read the docs.) You should also 
mention that 'predicate' runs with the Condition acquired.

Then +1 whether or not you do anything in response to the below comments.

* There's a small risk of confusion with C++0x's wait_for method, which behaves 
like the current Condition.wait (waiting for a timeout). They used "wait_for" 
because they also have a "wait_until" that waits until a deadline. I don't 
think this potential confusion is a big deal.

* This expands the interface needed to duck-type as a Condition. Maybe you 
could also add a threading.wait_for(Condition, predicate, timeout) that 
implements the same thing using just the Condition's .wait() method? I'm not 
certain that'll be the best name as a threading method, but I don't have a 
better proposal.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10260>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to