The RAISE_VARARGS opcode in Python 3

Arnaud Delobelle arnodel at
Fri Aug 26 18:20:38 EDT 2011

Hi all,

Here is an extract from the dis module doc [1]

Raises an exception. argc indicates the number of parameters to the
raise statement, ranging from 0 to 3. The handler will find the
traceback as TOS2, the parameter as TOS1, and the exception as TOS.

OTOH, looking at PEP 3109:

In Python 3, the grammar for raise statements will change from [2]

raise_stmt: 'raise' [test [',' test [',' test]]]

raise_stmt: 'raise' [test]

So it seems that RAISE_VARARGS's argument can only be 0 or 1 in Python
3, whereas it could be up to 3 in Python 2.  Can anyone confirm that
this is the case?  In this case, I guess the dis docs need to be

Thank you,



More information about the Python-list mailing list