How can I make a function equal to 0?

Grant Edwards grante at visi.com
Fri Mar 21 16:03:04 EDT 2008


On 2008-03-21, Paul Rubin <http> wrote:
> Martin Manns <mmanns at gmx.net> writes:
>> Is there a way to create a function that is equal to 0?
>
> def f(): return 0

I assumed he meant he wanted this to evaluate to True instead
of False:

  >>> def f(): return 0
  ... 
  >>> 
  >>> f == 0
  False

-- 
Grant Edwards                   grante             Yow! Yes, but will I
                                  at               see the EASTER BUNNY in
                               visi.com            skintight leather at an
                                                   IRON MAIDEN concert?



More information about the Python-list mailing list