#8120: UniqueRepresentation and hash value
------------------------------+---------------------------------------------
   Reporter:  hivert          |       Owner:                           
       Type:  defect          |      Status:  needs_work               
   Priority:  major           |   Milestone:                           
  Component:  algebra         |    Keywords:  UniqueRepresentation hash
     Author:  Florent Hivert  |    Upstream:  N/A                      
   Reviewer:  Paul Zimmerman  |      Merged:                           
Work_issues:                  |  
------------------------------+---------------------------------------------
Changes (by hivert):

  * status:  positive_review => needs_work


Comment:

 Replying to [comment:9 nthiery]:
 >
 > Just one thing Florent: please fix the following doctest:
 > {{{
 > sage: hash(x) # random
 > True
 > }}}
 > so that the reader expects some integer result.
 >
 > Maybe some test like:
 > {{{
 > sage: type(hash(x))
 > int
 > }}}
 > could be added.

 Oups !!! I'm resubmitting a patch with the following diff:
 {{{
 diff --git a/sage/structure/unique_representation.py
 b/sage/structure/unique_represent
 ation.py
 --- a/sage/structure/unique_representation.py
 +++ b/sage/structure/unique_representation.py
 @@ -483,7 +483,9 @@ class UniqueRepresentation:
              sage: x = UniqueRepresentation()
              sage: y = UniqueRepresentation()
              sage: hash(x) # random
 -            True
 +            74153040
 +            sage: type(hash(x))
 +            <type 'int'>
              sage: hash(x) == hash(y)
              True
              sage: class bla(UniqueRepresentation, SageObject): pass
 }}}

 Please re-review...

 Florent

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8120#comment:10>
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