[issue45711] Simplify the interpreter's (type, val, tb) exception representation

Irit Katriel report at bugs.python.org
Thu Nov 4 07:29:47 EDT 2021


New submission from Irit Katriel <iritkatriel at gmail.com>:

Exceptions are represented in the interpreter as (type, val, tb) triplets which most of the time contain redundant information (the type is the type of val and the tb is also on the exception). This complicates the code and is inefficient as opcodes that manage exceptions push and pop 3 items for each exception. 

We will change the internal representation to be (1) just the exception value if it is normalised and (2) a tuple of the 3 values for the uncommon case where they are all needed.

See also https://github.com/faster-cpython/ideas/issues/106.

----------
components: Interpreter Core
messages: 405681
nosy: Mark.Shannon, gvanrossum, iritkatriel
priority: normal
severity: normal
status: open
title: Simplify the interpreter's (type, val, tb) exception representation
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45711>
_______________________________________


More information about the Python-bugs-list mailing list