Ticket #14121: trac_14121_review-fc.patch

File trac_14121_review-fc.patch, 1.0 KB (added by chapoton, 8 years ago)
  • sage/combinat/words/shuffle_product.py

    # HG changeset patch
    # User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
    # Date 1362309515 -3600
    # Node ID a442346e37c37dcddf8d6f17e695dd3cb749eec3
    # Parent  313888c7b5c80ed64ea317dc5d6065c5be9d0b45
    trac #14121 add a test
    
    diff --git a/sage/combinat/words/shuffle_product.py b/sage/combinat/words/shuffle_product.py
    a b class ShuffleProduct_w1w2(CombinatorialC 
    6262            True
    6363            sage: w in S
    6464            False
     65
     66        We check that :trac:`14121` is solved::
     67
     68            sage: w = W('ab')
     69            sage: x = W('ac')
     70            sage: x*w in w.shuffle(x)
     71            True
    6572        """
    6673        from sage.combinat.words.word import Word
    6774        if not isinstance(x, Word_class):
    class ShuffleProduct_w1w2(CombinatorialC 
    8592            else:
    8693                return False
    8794        return len(wx) == 0
    88        
     95
    8996    def cardinality(self):
    9097        """
    9198        Returns the number of words in the shuffle product