What file is foo in package bar in ?

Christian Heimes lists at cheimes.de
Wed Aug 19 19:06:00 EDT 2009


northof40 wrote:
> Given an arbitary package is there some programmatic way to 'ask' what
> file the method/function is implemented in ?

Indeed, the inspect module contains several useful functions for the 
job, for example
http://docs.python.org/library/inspect.html#inspect.getfile

Christian




More information about the Python-list mailing list