This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author abrosimov.a.a
Recipients abrosimov.a.a
Date 2021-09-09.22:41:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1631227284.21.0.317045625732.issue45158@roundup.psfhosted.org>
In-reply-to
Content
1. Move internal dependencies (`FrameSummary`, `StackSummary`) to class attributes. Reduce coupling.
2. Separate receiving, processing and presenting traceback information.
How to replace `repr` with `pformat` in `FrameSummary`?
def __init__(...):
    ...
    self.locals = {k: repr(v) for k, v in locals.items()} if locals else None
    ...
3. Move formatting templates to class attributes.
4. ...

Motivation:
1. For the sake of small changes to the view, you have to rewrite the entire `TracebackException` hierarchy. Or use string parsing.
2.1. During development, I want to see as much information as possible.
2.2. During production, displaying unnecessary information can lead to security problems.
2.3. In large projects, it is more convenient to use JSON for further processing in the system environment.

I have not found any PEPs describing `traceback.py`.
I can make a prototype of the changes if anyone is interested.
History
Date User Action Args
2021-09-09 22:41:24abrosimov.a.asetrecipients: + abrosimov.a.a
2021-09-09 22:41:24abrosimov.a.asetmessageid: <1631227284.21.0.317045625732.issue45158@roundup.psfhosted.org>
2021-09-09 22:41:24abrosimov.a.alinkissue45158 messages
2021-09-09 22:41:24abrosimov.a.acreate