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 iritkatriel
Recipients iritkatriel
Date 2022-01-10.11:50:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-01-10 11:50:17iritkatrielsetrecipients: + iritkatriel
2022-01-10 11:50:17iritkatrielsetmessageid: <1641815417.01.0.0256923104095.issue46328@roundup.psfhosted.org>
2022-01-10 11:50:16iritkatriellinkissue46328 messages
2022-01-10 11:50:16iritkatrielcreate