Ticket #1795: class-coverage.patch

File class-coverage.patch, 1.3 KB (added by roed, 14 years ago)

A minor fix to how Python classes are printed

  • sage-coverage

    # HG changeset patch
    # User David Roe <roed@math.harvard.edu>
    # Date 1200511407 18000
    # Node ID 811fb2e1982db202565323991e0b51c9ce91e36e
    # Parent  d6493bcd84a594f460cbfb3cb00594dce1471435
    A few changes in how Python classes are handled.
    
    diff -r d6493bcd84a5 -r 811fb2e1982d sage-coverage
    a b def functions_without_doctests(file): 
    4141                file = file[j:]
    4242                continue
    4343
    44         if i == ii:
    45             function_name = ' '.join(file[i:j].lstrip('class').split())
    46         else:
    47             function_name = ' '.join(file[i:j].lstrip('def').split())
     44        function_name = ' '.join(file[i:j].lstrip('def').split())
    4845        if function_name.find("(") == -1 and (i != ii and function_name[:5] != 'class'):
    4946            file = file[i+3:]
    5047            continue
    5148        bare_function_name = function_name[:function_name.find("(")].rstrip()
     49        if i == ii:
     50            bare_function_name = ' '.join(bare_function_name.lstrip('class').split())
    5251        # a cdef'd or cpdef'd function may or may not indicate the type of its return value
    5352        # if it does, then function name and bare function name have that return
    5453        # value type at the beginning.