How to write detailed TODO comments in Python

Member

adelia_boyer

by adelia_boyer , in category: Python , 14 days ago

How to write detailed TODO comments in Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# TODO: fix this hell
def pretty_print(w, p):
    w = truncate(w)
    p = truncate(p)
    my_matrix = zip(p, w)
    print  "\n".join(["\t\t".join(["\t".join(map(str, r)) for r in t]) for t in my_matrix])        


# TODO: and this
def truncate(m):
    for i in range(len(m)):
        for j in range(len(m[0])):
            if(len(str(m[i][j])) > 5):
                m[i][j] = "%.3f" % m[i][j]
    return m


Facebook Twitter LinkedIn Telegram Whatsapp Pocket

no answers