Terry J. Reedy <tjre...@udel.edu> added the comment:
My understanding of the current code is that in the example above, f.__name__ would be "<lambda x, y=1: x + y>". 1. I believe this would make the representation <<lambda x, y=1: x + y> at 0x........> unless functions gain a custom __repr__ method that strips the brackets off the name when present. I don't really like the alternative of leaving the brackets off the name. 2. My proposal is to limit the length of the .__name__ attribute. This not only limits the repr but also the function name part of traceback lines. I consider the latter more important as I personally see function names in tracebacks far more often than in representations. Long function names wrapped to several lines would in my opinion negatively affect tracebacks. Large collections do not affect tracebacks. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34856> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com