Irit Katriel <iritkatr...@gmail.com> added the comment:

The second opcode that the PR adds is PREP_RERAISE_STAR.

This opcode takes a list that contains:
1. all the exceptions that were raised in the executed except* clauses
2. the unmatched part of the exception group

It constructs the exception group that needs to be raised at the end.  This is 
done through a fairly complex operation on the BaseExceptionGroup, which merges 
the re-raised exceptions into the same nesting structure they had in the 
original exception group, so that

try:
   raise eg
except* ValueError:
   raise
except* TypeError:
   raise

is equivalent to just 'raise eg'.


Is there any overlap with existing opcodes?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45292>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to