[issue10260] Add a threading.Condition.wait_for() method

2010-11-18 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Committed as revision 86510 -- resolution: -> accepted status: open -> closed ___ Python tracker ___ _

[issue10260] Add a threading.Condition.wait_for() method

2010-11-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Good point, Antoine. I'm always trying to keep those timeouts low, > however, to avoid having the testsuite duration grow too much with > every test :) Well, better to have slower tests than intermittently failing ones, I say. -- __

[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Good point, Antoine. I'm always trying to keep those timeouts low, however, to avoid having the testsuite duration grow too much with every test :) I think we can probably fix the issue by having the lock_tests.Bunch() function only return when all t

[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Ok, here is a new patch which slightly expands the documentation and improves > the timeout unittest. > If there are no objections I'll then commit this shortly. Again, I think you should use a larger timeout value than 0.1, to avoid intermittent buildbot fa

[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Georg Brandl
Georg Brandl added the comment: Good, but please wait until after the a4 freeze. -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue10260] Add a threading.Condition.wait_for() method

2010-11-13 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Ok, here is a new patch which slightly expands the documentation and improves the timeout unittest. If there are no objections I'll then commit this shortly. -- Added file: http://bugs.python.org/file19594/wait_for2.patch _

[issue10260] Add a threading.Condition.wait_for() method

2010-11-03 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: On Tue, Nov 2, 2010 at 4:29 AM, Antoine Pitrou wrote: >> I spent some time thinking of a name.  I tried wait_predicate and >> predicate_wait, but wait_for seemed natural.  Any other ideas? >> How about wait_until_true? > > wait_for is ok IMO. Agreed. >> My o

[issue10260] Add a threading.Condition.wait_for() method

2010-11-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I spent some time thinking of a name. I tried wait_predicate and > predicate_wait, but wait_for seemed natural. Any other ideas? > How about wait_until_true? wait_for is ok IMO. > My original method had this as a free function, but I moved it into > the Co

[issue10260] Add a threading.Condition.wait_for() method

2010-11-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: Good points, Jeffrey. Documentation can be improved and cond.wait_for(pred) is indeed not guaranteed to wake up when predicate is true unless someone calls notifyAll. I spent some time thinking of a name. I tried wait_predicate and predicate_wait,

[issue10260] Add a threading.Condition.wait_for() method

2010-11-01 Thread Jeffrey Yasskin
Jeffrey Yasskin 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, desp

[issue10260] Add a threading.Condition.wait_for() method

2010-11-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: This looks useful indeed. -- nosy: +jyasskin, pitrou ___ Python tracker ___ ___ Python-bugs-list ma

[issue10260] Add a threading.Condition.wait_for() method

2010-11-01 Thread Kristján Valur Jónsson
Kristján Valur Jónsson added the comment: The wait_for() method is basically a distillation of the Semaphore.acquire() method, which tries to intelligently handle a non-trivial timeout. With this method it is now possible to simplify Semaphore.acquire, although I didn't want to do so in this p

[issue10260] Add a threading.Condition.wait_for() method

2010-10-31 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- title: Add a thrading.Condition.wait_for() method -> Add a threading.Condition.wait_for() method ___ Python tracker ___ ___