Message410204
Following to changes in issue45711, the interpreter's internal representation of the active exception is just the exception instance (the exc_type and exc_traceback fields were removed).
For backwards compatibility, sys.exc_info() constructs the (typ, val, tb) tuple from the instance and this will continue to be the case for some time because this tuple has leaked into quite a few APIs.
However, now that the redundancy in the exc_info tuple is guaranteed by the way it's constructed, we can confidently add a sys.exception() method that returns just the exception instance (as suggested in PEP3134's section on future improvements).
This small change will make a difference to learners because the (typ, val, tb) tuple looks quite cryptic to those who don't know about tracebacks, and the redundancy in it is confusing for those who do. |
|
Date |
User |
Action |
Args |
2022-01-10 11:50:17 | iritkatriel | set | recipients:
+ iritkatriel |
2022-01-10 11:50:17 | iritkatriel | set | messageid: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org> |
2022-01-10 11:50:16 | iritkatriel | link | issue46328 messages |
2022-01-10 11:50:16 | iritkatriel | create | |
|