#11611: Equal PARI integers have different hashes
-----------------------------+----------------------------------------------
   Reporter:  jdemeyer       |          Owner:  jdemeyer                    
       Type:  defect         |         Status:  positive_review             
   Priority:  critical       |      Milestone:  sage-4.7.2                  
  Component:  number fields  |       Keywords:  pari cgetg integer ideal hnf
Work_issues:                 |       Upstream:  N/A                         
   Reviewer:                 |         Author:  Jeroen Demeyer              
     Merged:                 |   Dependencies:                              
-----------------------------+----------------------------------------------

Comment(by jdemeyer):

 Replying to [comment:9 tornaria]:
 > I'm also wondering if the hash of a pari integer should match the hash
 of the corresponding sage or python integers. That is carefully considered
 in the sage integers/rationals, etc. The principle is that two values that
 are equivalent (for the purposes of equality comparision) should have the
 same hash to avoid nastiness in using the values as dictionary keys. The
 same would be true for some other pari types.

 This looks quite hard.  You would really have to rewrite the PARI hash
 function for this to match the Sage hash functions or the other way
 around.  Also, consider that PARI objects are rarely directly visible in
 Sage.  They usually live in private members of classes, so are unlikely to
 end up as dictionary keys.  And even if they do, it would be even rarer to
 mix PARI and Sage types.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11611#comment:11>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to