Re: finding out the call (and not only the caller)
- From: Carl Friedrich Bolz <cfbolz@xxxxxx>
- Date: Sun, 28 Oct 2007 21:42:42 +0100
Hi Neal,
nnorwitz@xxxxxxxxx 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
.
- References:
- finding out the call (and not only the caller)
- From: Francesco Guerrieri
- Re: finding out the call (and not only the caller)
- From: nnorwitz@xxxxxxxxx
- finding out the call (and not only the caller)
- Prev by Date: Readline on OS X for trunk build
- Next by Date: Problem--IOError: [Errno 13] Permission denied
- Previous by thread: Re: finding out the call (and not only the caller)
- Next by thread: tinyp2p - trying to get it to work
- Index(es):
Relevant Pages
|