[Python-ideas] Logical tracebacks

Anders Hovmöller boxed at killingar.net
Tue Apr 16 02:10:32 EDT 2019



> On 15 Apr 2019, at 22:07, Antoine Pitrou <solipsis at pitrou.net> wrote:
> 
> However, there are many contexts where implementation details would
> benefit from being hidden from tracebacks (the classical example being
> the internals of framework or middleware code, such as Django, Dask,
> etc.).  We would therefore have to define some kind of protocol by
> which tracebacks can be enumerated, not only as frames, but as logical
> execution blocks, comprised of one or several frames each, whose
> boundaries would reflect the boundaries of the various logical
> execution layers (again: framework, middleware...) involved in the
> frame stack.  We would probably also need some flag(s) to disable the
> feature in cases where the full stack frame is wanted (I imagine
> elaborate UIs could also allow switching back and forth from both
> representations).

At work I've implemented a super simple system where frames with file names that match some simple patterns are put in bold. This helps enormously while not hiding information that can be crucial at times. 

I'd recommend people try this approach and see how it feels. It's very easy to implement compared to the alternatives suggested so far in this thread. I'd also argue that even if the more complex hiding methods mentioned are implemented then this method can still be very useful on top of those other changes. 

/ Anders 


More information about the Python-ideas mailing list