How can I make a function equal to 0?

Martin Manns mmanns at gmx.net
Fri Mar 21 21:02:01 CET 2008


On 21 Mar 2008 12:52:12 -0700
Paul Rubin <http://phr.cx@NOSPAM.invalid> wrote:

> def f(): return 0

Let us try it:

Python 2.5.1 (r251:54863, Jan 26 2008, 01:34:00) 
[GCC 4.1.2 (Gentoo 4.1.2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> def f(): return 0
... 
>>> f==0
False
>>> f()==0
True
>>> 


I do not want the function to return 0 but to equal 0.

Martin



More information about the Python-list mailing list