What file is foo in package bar in ?

Christian Heimes lists at cheimes.de
Thu Aug 20 01:06:00 CEST 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