[Python-Dev] script containing all opcs

Georg Brandl g.brandl at gmx.net
Sat Aug 30 15:15:09 CEST 2008


Michal Revucky schrieb:
> hello everyone,
> 
> i would like to get a python script which executes all interpreter's opcodes, or
> how am i supposed to create such script... i just need to make sure that all
> opcodes (as defined in Include/opcode.h) are executed by this scrip 
> i need this script for testing purposes while rewritting the python's ceval.c 
> code...

This question might better suit comp.lang.python, but nevertheless:
The opcodes are quite well documented, in the documentation of the
"dis" module. Many of them serve a specific purpose (like implementing
`x[y]` or `raise x`) and should therefore be easy to test. For the
others, like ROT_TWO, you'll need to look into Python/compile.c to
find out in which cases they are generated.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-Dev mailing list