how to get the last interactive command enetered

Martin von Loewis loewis at informatik.hu-berlin.de
Sun Mar 4 05:51:04 EST 2001


"Tom" <NoSpam at NoSpam.com> writes:

> > No. Once the code is executed, the source code is dropped. All you can
> > get at is the binary code.
> 
> But when I catch a 'call' trace event the code has not been executed.  I
> believe that it has been parsed and compiled but not executed (till I get
> the 'return' trace event).

Yes, it has been parsed and compiled, the result of which was a code
object (which in turn was put into a function object). After that, the
source code, and the abstract syntax tree, is discarded (actually the
source code is discarded in the process of parsing).

The code object has a file name in it and line numbers, that's all
that's left from the source.

Regards,
Martin



More information about the Python-list mailing list