> 2013/10/8 John Cremona <john.c...@gmail.com <javascript:>> > >> Now a mathematician would argue that the last one should raise some >> kind of error since we are apparently asking for the equality of >> objects in incomparable domains. But Python requires (I believe) that >> == should always return True or False, so that is not an option. >> > > I can't find such a restriction here: > > http://docs.python.org/3/reference/datamodel.html#object.__eq__ > > Returning any value (explicitly including NotImplemented) is allowed, > nothing is said about raising exceptions. > > It is a convention that the rich comparisons (and "in") should never raise an (uncaught) exception.
Best, 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 sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.