Sybren Stuvel <[EMAIL PROTECTED]> wrote:

> Dan Bishop enlightened us with:
> >>>> a = b = 1e1000 / 1e1000
> >>>> a is b
> > True
> >>>> a == b
> > False
> 
> If "a is b" then they refer to the same object, hence a == b. It
> cannot be otherwise, unless Python starts to defy logic. I copied your

Python also needs to respect standards (such as IEEE 754 for
floating-point arithmetic, and the SQL standards) which do specify the
existence of special objects that "are not equal to anything" including
themselves -- Nan and NULL respectively for these two standards.

We're talking about extremely widespread international standards
developed by huge body of professionals which do include professional
logicians, so I doubt they "defy logic".  Python tries to delegate FP to
the underlying hardware and SQL to an external relational DB engine, so
it should be as compliant as the pieces of infrastructure it's using --
which seems to me to be a good architectural decision (not just for
speed and ease of coding, but to ensure any anomaly is somebody else's
fault:-).


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

Reply via email to