HowCanI: inlined exceptions

Thomas Wouters thomas at xs4all.net
Sat May 27 01:12:58 CEST 2000


On Fri, May 26, 2000 at 10:11:59PM +0000, Shae Erisson wrote:

> *false in Python is zero, empty string, empty list, empty tuple, or
> None, and anything else is true. (unless I'm missing something)

Empty dicts are false as well, and class-instances can define for themselves
wether they are true or false, by using a method called __nonzero__, I
believe.

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list