Hi,

I'd like some confirmation for the patch at 
http://www.sagetrac.org/sage_trac/ticket/1075
The purpose of the patch is to fix the lack of substitution in the following 
code snippet (it also has other ramifications in similar contexts):
sage: R.<x,y>=ZZ[]
sage: (x/y).subs({x:1})
x/y

The patch is to add a __hash__ method to the FractionFieldElement class to 
make fractions with denominator 1 hash the same as the numerator.  Thus, this 
patch makes == and __hash__ agree for the case of embedding a ring into it's 
fraction field.

For some reason, which is a mystery to me, that code snippet works as expected 
if you replace ZZ with QQ.  I realize that behind the scenes that gives you 
an entirely different implementation (for the poly ring -- not the 
fractionfield), but I don't understand why the hash values somehow work out 
for the QQ case, but not the ZZ case.

Note that '==' and __hash__ have been hashed (pardon the pun) at some length 
in the thread with this message:
http://groups.google.com/group/sage-devel/msg/b3812493e9d2d2c8

thanks
Joel

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to