#17427: x==y while hash(x)!=hash(y) with SchemeMorphism_point_projective_field
---------------------------------+------------------------
Reporter: ncohen | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.5
Component: PLEASE CHANGE | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------------+------------------------
Comment (by bhutz):
Notice that the sage developers guide says the following about hash:
'“The only required property is that objects which compare equal have the
same hash value.” This is an assumption made by the Python language, which
in Sage we simply cannot make!'
Now, I'm not saying that we don't want to do everything reasonable we can
to make the implication work, I have to ask if maybe this is one of those
cases where it is not reasonable. Sure, the ZZ example was trivial, but
for rings without GCDs, there are less trivial examples:
{{{
R.<x>=PolynomialRing(QQ)
K.<w>=NumberField(x^2+3)
O=K.maximal_order()
P.<x,y>=ProjectiveSpace(O,1)
Q1=P([1+w,2])
Q2=P([2,1-w])
Q1==Q2
}}}
Is there a way to assign Q1 and Q2 the same hash value without searching
through the list of previously made hash values for an == and then
assigning the Q2 hash value to that value?
--
Ticket URL: <http://trac.sagemath.org/ticket/17427#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" 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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.