On Thursday, December 15, 2016 at 10:24:05 AM UTC+1, Marc Mezzarobba wrote:
>
> Travis Scrimshaw wrote:
> > We need to be very careful about defining "not knowing". I (stongly)
> > believe when the objects/types are incomparable (say the rings ZZ and
> > QQ), then == should return False and != should return True.
> > Subsequently, when there is no coercion between the parents, they
> > should not raise an error.
>
> Does anyone else have comments on this issue? Specifically, what should
> x != y do in your opinion when
> - x is a Sage Element,
> - y is
> (i) another Element, or
> (ii) a non-Element that does not implement rich comparison
> with Elements,
> - and the coercion framework finds no common parent for x and y?
> The main options are to:
> (a) return True,
> (b) raise a TypeError.
> Note that this is not equivalent to asking what == should do in a
> similar situation.
>
After I read this, I have read only Python3 doc about == and != comparison
operators. From this base, my simple-minded opinion(or expectation) is:
(1) "x != y" should behave always and exactly as "not (x == y)"
(2) When parents of x and y are different after coercion, "x != y" ("x ==
y") returns True (False) for both (i) and (ii)
(3) "x != y" and "x == y" never raise an exception.
I seems to agree with Travis.
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.