On Wednesday, June 11, 2014 8:40:54 AM UTC+1, Marc Mezzarobba wrote:
>
> Not that bad if x != 1 throws an exception. Besides, Java programmers 
> have had a similar problem forever and can apparently live with it... 


Comparisons in Java are probably one of the #1 traps for the unwary (and 
inconsistent between primitives and objects). But at least for objects, 
Java "==" is just the Python "is". And ".equals()" is Python "==". So there 
you have your two comparisons already. Really, you are asking for a third. 

IMHO that should always go into some ".is_isomorphic()" method in Sage when 
the kind of isomorphism considered is just weak enough. 

The Python rule that "==-equal object must have the same hash" really is 
only for objects that you want to put into an associative container. You 
don't gain anything by trying to make it into a global rule, it'll only 
make Sage very hard to use interactively.

-- 
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/d/optout.

Reply via email to