What values are considered false?
Andrew Dalke
dalke at dalkescientific.com
Thu Feb 21 14:27:48 EST 2002
Harvey Thomas:
> The empty function is not only false, it is also None
>
> In the interpreter,
>
> def foo():pass
>
> foo() is None
>
> 1
Not quite. You called the fuction 'foo', which doesn't
define a return value so the value None is used instead.
To compare the function to None, do
foo is None
and you'll get 0.
Andrew
dalke at dalkescientific.com
More information about the Python-list
mailing list