[Python-ideas] Add __nonzero__ to threading.Event
Aahz
aahz at pythoncraft.com
Sun May 10 19:20:16 CEST 2009
On Sun, May 10, 2009, Floris Bruynooghe wrote:
>
> 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+).
>
> [...]
>
> Is it worth submitting this to the tracker or is there some reason why
> this is a bad idea that I've missed?
Please submit to the tracker so that even if it *is* a bad idea it will
get recorded.
--
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
"It is easier to optimize correct code than to correct optimized code."
--Bill Harlan
More information about the Python-ideas
mailing list