Hi Neal, [EMAIL PROTECTED] wrote: > The code doesn't handle all the cases (e.g., nested functions), but > gives you an idea of what can be done and where to look for the info > (ie, in the stack frame and how to parse the byte codes to some > extent). For nested functions, look in co_consts. > > Bytecodes are specific to CPython. This code won't work on > IronPython, Jython, or PyPy. This code really shouldn't be used for > production. However, it demonstrates some of the info available.
Actually that's not true for PyPy. PyPy uses CPython's bytecode, so the example works just fine. Cheers, Carl Friedrich Bolz -- http://mail.python.org/mailman/listinfo/python-list