11 May
2009
11 May
'09
4:51 p.m.
Floris Bruynooghe
Hi
I was wondering why threading.Event hasn't got the __nonzero__ special attribute? I think it would allow for code to be more pythonic if you could just do "if e: ..." instead of "if e.isSet(): ..." (or "if e.is_set(): ..." in 2.6+).
-1 As with Antoine, I find conflating an Event's flag with its boolean value confusing. I also don't see other precedent for this in the standard library. (locks for example)