while true: !!!

Greg Ewing greg at cosc.canterbury.ac.nz
Wed Dec 20 04:17:57 CET 2000

Tim Hochberg wrote:
> If I attempt to summarize I get the following for false items:
> * None
> * Anything that equals zero (Including a class instance with __nonzero__
> returning false)
> * An empty sequence (Including a class instance with __len__ returning 0)

The fact that it's taken about three attempts by
experienced Python people to come up with a full
and accurate characterisation of what constitute
'true' and 'false' in Python suggests that things 
could have been a lot simpler if there had been a 
dedicated boolean type!

Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  

More information about the Python-list mailing list