[issue45292] Implement PEP 654: Exception Groups

Irit Katriel report at bugs.python.org
Tue Dec 14 15:45:24 EST 2021


Irit Katriel <iritkatriel at gmail.com> added the comment:

The PR adds two new opcodes. Let's start with the simpler of the two - JUMP_IF_NOT_EG_MATCH.   This is the exception-group variation on JUMP_IF_NOT_EXC_MATCH.

JUMP_IF_NOT_EXC_MATCH checks for a match by checking if the exception is of the given type. The result is boolean.

JUMP_IF_NOT_EG_MATCH checks for a matching by calling .split() on the exception group. The result is two exception groups (the matching part and the non-matching part).

Can we do this without a new opcode?

----------

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


More information about the Python-bugs-list mailing list