Meta Line information in Python?
Terry Reedy
tjreedy at udel.edu
Thu Jul 4 10:30:16 EDT 2002
"Tan Woon Kiong" <thomas_sg2000 at yahoo.com> wrote in message
news:f735e100.0207040009.62d21938 at posting.google.com...
> Hi,
>
> Is there a way to specify meta line information in Python?
>
> For instance, in C language, this can be done by writing the
statement
> #line <line-no> "<src file>"
There are internal __file__ and __lineno__ (spelling?) vars which are
used to print tracebacks. I do not know if they are writable from
Python (as opposed to C code compiled into the interpreter). You
might investigate
Terry J. Reedy
More information about the Python-list
mailing list