Ticket #12946: trac_12946-review.patch

File trac_12946-review.patch, 1.2 KB (added by mhansen, 10 years ago)

Removing some garbage from the top of the file

  • sage/combinat/composition.py

    # HG changeset patch
    # User Andrew Mathas <andrew.mathas at sydney.edu.au>
    # Date 1345621579 -36000
    # Node ID 1aa928fca2a7dc19b8950f25b672ed7b4c2f6e58
    # Parent  da198d4b9e496b363a9c370f4627bdd2cacbc574
    #12946: Bug in Compositions (fix when inner keyword is a composition)
    
    diff --git a/sage/combinat/composition.py b/sage/combinat/composition.py
    a b def Compositions(n=None, **kwargs): 
    944944        [[1, 3], [1, 2, 1]]
    945945        sage: Compositions(4, inner=[1,1,1]).list()
    946946        [[2, 1, 1], [1, 2, 1], [1, 1, 2], [1, 1, 1, 1]]
     947        sage: Compositions(4, inner=Composition([1,2])).list()
     948        [[2, 2], [1, 3], [1, 2, 1]]
    947949        sage: Compositions(4, min_slope=0).list()
    948950        [[4], [2, 2], [1, 3], [1, 1, 2], [1, 1, 1, 1]]
    949951        sage: Compositions(4, min_slope=-1, max_slope=1).list()
    def Compositions(n=None, **kwargs): 
    981983                del kwargs['outer']
    982984
    983985            if 'inner' in kwargs:
    984                 inner = kwargs['inner']
     986                inner = list(kwargs['inner'])
    985987                kwargs['floor'] = inner
    986988                del kwargs['inner']
    987989                # Should this be handled by integer lists lex?