New submission from Martin Morrison: traceback.py contains a lot of code duplication, which makes it fragile in the face of changes (i.e. special cases) to the stack/traceback output (I am separately working on just such a change).
The attached patch refactors the code to reduce to a single function for each bit of logic, wrapped by the various existing APIs. The new helper functions are refactored as generators so as not to create unnecessary transient lists (not that stacks usually get very big anyway). I've fully tested the replacement module, and it passes all the traceback tests in the standard suite. ---------- components: Library (Lib) files: traceback.diff keywords: patch messages: 186142 nosy: isoschiz priority: normal severity: normal status: open title: traceback.py has a lot of code duplication type: enhancement versions: Python 3.4 Added file: http://bugs.python.org/file29692/traceback.diff _______________________________________ Python tracker <[email protected]> <http://bugs.python.org/issue17646> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
