introspection?

Jim Benson jbenson at lowell.edu
Wed Aug 18 21:51:02 EDT 2004


On Wed, 18 Aug 2004, Troy Melhase wrote:

> import sys
> def F():
>     print sys._getframe().f_code.co_name
> >>> F()
> F

ooooh...thanks Troy!
indeed that works fine for getting the method name.

Thanks to all...and apologies for taking the easy way out
by posting to this very helpful list rather than 
doing more research with google (actually i did
do a search for 'python class method introspection' 
before posting...i didn't look at all the returns).

Thanks,

Jim







More information about the Python-list mailing list