Guido van Rossum wrote: > Since this can conceivably be going on in parallel in multiple > threads, we really don't ever want to be sharing whatever object > contains the head of the chain of tracebacks since it mutates at every > frame bubble-up. So (full) exceptions can't be unitary objects. In theory, raising an already-instantiated instance could indicate "no traceback", which could make pre-cooked exceptions even lighter. Otherwise, there is no way to make exceptions reference their traceback directly. Using a property which depends on both the exception and the frame asking (catching frame? thread?) is ... probably worse than keeping them separate. >>> except MyException as err, tb isn't so awful, and makes it clear that the traceback is no longer needed after the more typical >>> except MyException as err ... # no raise statements needing a context or cause -jJ
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4