How to get the package, file, and line of a method/function invocant?

Miki miki.tebeka at gmail.com
Tue Sep 12 02:30:35 EDT 2006


> > I am looking for something like the caller() routine in Perl:
> >    http://perldoc.perl.org/functions/caller.html
>
> Look at the inspect module in Python's standard library.
Or is you're feeling lazy, have a look at the "here" function found in
http://www.unixreview.com/documents/s=9133/ur0404e/ur0404e_listing1.htm

--
Miki
http://pythonwise.blogspot.com




More information about the Python-list mailing list