Ticket #12946: trac_12946.patch

File trac_12946.patch, 1.2 KB (added by mhansen, 10 years ago)
  • sage/combinat/composition.py

    # HG changeset patch
    # User Mike Hansen <mhansen@gmail.com>
    # Date 1337038347 25200
    # Node ID c67fc5f831a098772a4a5709f09f5909c9da87d1
    # Parent  c36366c6b69e048c219ecb8994e1ee2a946a2f5c
    #12946: Bug in Compositions
    
    diff --git a/sage/combinat/composition.py b/sage/combinat/composition.py
    a b  
    664664        [[4], [2, 2]]
    665665        sage: Compositions(4, outer=[3,1,2]).list()
    666666        [[3, 1], [2, 1, 1], [1, 1, 2]]
     667        sage: Compositions(3, outer = Composition([3,2])).list()
     668        [[3], [2, 1], [1, 2]]
    667669        sage: Compositions(4, outer=[1,oo,1]).list()
    668670        [[1, 3], [1, 2, 1]]
    669671        sage: Compositions(4, inner=[1,1,1]).list()
     
    697699                warn("Currently, setting min_part=0 produces Composition objects which violate internal assumptions.  Calling methods on these objects may produce errors or WRONG results!", RuntimeWarning)
    698700
    699701            if 'outer' in kwargs:
    700                 kwargs['ceiling'] = kwargs['outer']
     702                kwargs['ceiling'] = list(kwargs['outer'])
    701703                if 'max_length' in kwargs:
    702704                    kwargs['max_length'] = min( len(kwargs['outer']), kwargs['max_length'])
    703705                else: