'copied from standard repr.py and fixed to work on multithreadedly mutating lists.'

def repr_list(self, obj, level):

    if (level <= 0):
        return '[...]'
    n = len(obj)
    myl = obj[:min(n, self.maxlist)]
    s = ''
    for item in myl:
        entry = self.repr1(item, (level - 1))
        if s:
            s = (s + ',    ')
        s = (s + entry)
    if (n > self.maxlist):
        s = (s + ',    ...')
    return (('[' + s) + ']')
