[Python-ideas] Add __nonzero__ to threading.Event

Floris Bruynooghe floris.bruynooghe at gmail.com
Tue May 12 17:02:06 CEST 2009


On Sun, May 10, 2009 at 10:20:16AM -0700, Aahz wrote:
> 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.

http://bugs.python.org/issue5998


Regarsds
Floris



More information about the Python-ideas mailing list