#19055: Tableau hash depends on subclass
-------------------------------------+-------------------------------------
       Reporter:  darij              |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.9
      Component:  combinatorics      |   Resolution:
       Keywords:  tableaux, hashing  |    Merged in:
        Authors:  Darij Grinberg     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/combinat/tableau_hash       |  27788705a3241374377904895b341c9c504605df
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 I recall Nicolas telling me that having equality and the hash dependent on
 the parent was the goal in order to better conform to the hash
 requirement. However, this means we have to be much more careful about our
 return types. Plus it might be surprising for a user, say, a combinatorics
 student using Sage for a class.

 Here's a possible approach I just thought of. We put a private attribute
 in the parent class that points to a particular class, and we use it to
 compare equality and the hash of that class in the element's `__hash__`.
 So it would preserve some information about the parent, but it would be
 controllable. So we could still have, e.g., tableaux and semistandard
 tableaux compare as equal, but have a be different than GT patterns. A
 variant of this would be to make it a method, so once can return instances
 of the parent class if necessary. Thoughts?

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

Reply via email to