#14772: Remove CombinatorialClass from Permutations
------------------------------------+------------------------------------
       Reporter:  tscrim            |         Owner:  sage-combinat
           Type:  enhancement       |        Status:  needs_review
       Priority:  major             |     Milestone:  sage-5.11
      Component:  combinatorics     |    Resolution:
       Keywords:  days49            |     Merged in:
        Authors:  Travis Scrimshaw  |     Reviewers:
Report Upstream:  N/A               |   Work issues:
         Branch:                    |  Dependencies:  #8386 #14519 #14808
       Stopgaps:                    |
------------------------------------+------------------------------------

Comment (by darij):

 I tried this:
 {{{
 @@ -3845,10 +3879,20 @@ class Permutations_mset(Permutations):
                  sage: S = Permutations(['c','a','c'])
                  sage: elt = S(['c','c','a'])
                  sage: elt.check()
 +                sage: elt2 = S(['c','c','c'])
 +                Traceback (most recent call last):
 +                ...
 +                ValueError: Invalid permutation
              """
              mset = self.parent().mset
 +            selfdict = {}
              for val in self:
 -                if val not in mset:
 +                if val in selfdict:
 +                    selfdict[val] += 1
 +                else:
 +                    selfdict[val] = 1
 +            for (val, mult) in selfdict.items():
 +                if mult != mset.count(val):
                      raise ValueError("Invalid permutation")

      def _repr_(self):
 }}}

 But this breaks various doctests since apparently the same {{{check}}}
 method is used for permutations of length k. I have reverted that change
 for now.

 If you ask me, it is a stupid idea to have permutations of length k
 inherit from permutations anyway...

--
Ticket URL: <http://trac.sagemath.org/ticket/14772#comment:36>
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/groups/opt_out.


Reply via email to