script containing all opcs
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... bye michal
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.
participants (2)
-
Georg Brandl
-
Michal Revucky