Ticket #9370: trac_9370-module-elt-repr-fourth.patch

File trac_9370-module-elt-repr-fourth.patch, 862 bytes (added by jhpalmieri, 10 years ago)

apply on top of first 3 patches, for review only

  • sage/combinat/free_module.py

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1299882889 28800
    # Node ID 084304627d178b4162e77949558eb477bafd6760
    # Parent  aa85d4dd6a8957e45e6ecff7a0c1d7dca1efc721
    #9370: patch 4
    
    diff -r aa85d4dd6a89 -r 084304627d17 sage/combinat/free_module.py
    a b class CombinatorialFreeModuleElement(Ele 
    203203            if ast == '*':
    204204                ast = ''
    205205        ast_replace = ast if ast else ''
    206         l = len(ast_replace)
     206        ln = len(ast_replace)
    207207        x = repr_lincomb(mons, cffs, is_latex=True, latex_scalar_mult=ast)
    208         if x[len(x)-l-1:] == ast_replace+"1":
    209             return x[:len(x)-l-1]
     208        if ln>0 and x[len(x)-ln-1:] == ast_replace+"1":
     209            return x[:len(x)-ln-1]
    210210        else:
    211211            return x
    212212