def tracemessage(self, maxlen=<NUM_LIT:6>):
result = "<STR_LIT>"<EOL>for i, value in enumerate(self):<EOL><INDENT>result += "<STR_LIT>".format(i, get_node_repr(value))<EOL><DEDENT>result = result.strip("<STR_LIT:\n>")<EOL>lines = result.split("<STR_LIT:\n>")<EOL>if maxlen and len(lines) > maxlen:<EOL><INDENT>i = int(maxlen / <NUM_LIT:2>)<EOL>lines = lines[:i] + ["<STR_LIT>"] + lines[-(maxlen - i) :]<EOL>result = "<STR_LIT:\n>".join(lines)<EOL><DEDENT>return result<EOL>
if maxlen > 0, the message is shortened to maxlen traces.