testutil.py 272 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# -----------------------------------------------------------------------------
# Utils

def append(x,y):
    return x + y

def concat(xs):
    return reduce(append,xs)

def chop(s):
    if s[len(s)-1:] == '\n':
        return s[:len(s)-1]
    else:
        return s