Result of ``a is b''
Andrew Koenig
ark at acm.org
Fri Mar 19 11:29:19 EST 2004
"Carl Banks" <imbosol at aerojockey.invalid> wrote in message
news:2eu6c.25407$P45.19517 at fe1.columbus.rr.com...
> > I don't think the argument that one can redefine __eq__
> > to be something other than an equivalence relation is a
> > particularly strong argument. I would call that a bug,
> > even if it is a deliberate bug. If "==" doesn't do
> > equality, then it is an exceedingly bad piece of design.
> You know, it's not hard to imagine some abstract mathematical superset
> of the normal orthogonal math we use everyday, wherein certain numbers
> (or sets or whatever) are not equal to themselves. In which case it
> would be entirely appropriate for __eq__ to return False if called
> with the same object. Of course, that's not really the typical case.
I'm pretty sure that IEEE floating point requires NaN to be defined in such
a way that if x is NaN, then x == x must yield False.
More information about the Python-list
mailing list