Author jyasskin
Recipients georg.brandl, jyasskin, kristjan.jonsson, pitrou
Date 2010-11-04.02:04:56
SpamBayes Score 2.25845e-10
Marked as misclassified No
Message-id <AANLkTik=zGVD3sZJ2VEbWc608LmwXsiR4wGCb0d4JsPS@mail.gmail.com>
In-reply-to <1288697339.3549.1.camel@localhost.localdomain>
Content
On Tue, Nov 2, 2010 at 4:29 AM, Antoine Pitrou <report@bugs.python.org> 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 original method had this as a free function, but I moved it into
>> the Condition because I could see no other kind of primitive that
>> would use it.  I agree that it is unfortunate to pull what is
>> essentially a utility function into the Condition variable, so I am
>> leaning towards keeping it a module function.
>
> I'm not sure I see the point. It's an operation on a Condition variable,
> so it's natural to have it as a Condition method. A module function
> would feel rather weird.

Yeah, it should primarily be used as a Condition method. I was
suggesting implementing that Condition method in terms of a threading
function, which would also help other people trying to, say, mock
Condition objects. But that's not a big deal, and I could be wrong
about whether it's useful at all. As I said earlier, I'm happy with
this patch either way. (Note that Condition.wait_for is helpful to
people mocking Condition anyway, since the number of calls is much
more fixed than the calls to Condition.wait.)
History
Date User Action Args
2010-11-04 02:05:00jyasskinsetrecipients: + jyasskin, georg.brandl, pitrou, kristjan.jonsson
2010-11-04 02:04:58jyasskinlinkissue10260 messages
2010-11-04 02:04:56jyasskincreate