On Sunday, December 18, 2016 at 10:58:42 AM UTC+1, Marc Mezzarobba wrote: > > Thank you for you comments. > > Kwankyu Lee wrote: > > (1) "x != y" should behave always and exactly as "not (x == y)" > > This is difficult to achieve.
> For example, in interval arithmetic, one usually expects a == b to > return True iff a and b are equal point intervals, and a != b to return > True iff a and b are disjoint intervals. Do we have such cases in Python proper? I mean a case that disobeys (1). It is unfortunate if Sage is different in this respect. Also, for lots of objects > coming up in computer algebra (e.g., symbolic expressions in one > variable), the equality test is either undecidable or at least not known > to be decidable. > I see "==/!=" more as programming tools, and expect that they do not attempt to do difficult mathematical comparison that can lead to long computation or results other than True or False. I expect that the comparison operators try to return mathematically sensible result as far as it is practical (one systematic way is to use coercion), and do something else (but still True or False) that is clearly documented as soon as any difficulty you mentioned can arise. > (3) "x != y" and "x == y" never raise an exception. > > Why? We are not talking about raising exceptions all the time, only in > cases where it is likely that there is a bug... Because you mentioned TypeError as an option. -- 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.
