On Tue, 28 May 2013 01:39:09 -0700, Ahmed Abdulshafy wrote:

> He just said that the way to test for zero equality is x == 0, and I
> meant that this is true for integers but not necessarily for floats. And
> that's not specific to Python.

Can you show me a value of x where x == 0.0 returns False, but x actually 
isn't zero?

Built-in floats only, if you subclass you can do anything you like:

class Cheating(float):
    def __eq__(self, other):
        return False


-- 
Steven

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to