Getting method name from within the class method

Mitko Haralanov mitko at qlogic.com
Thu Oct 19 20:53:35 EDT 2006


On 18 Oct 2006 21:01:36 -0700
"George Sakkis" <george.sakkis at gmail.com> wrote:

> from inspect import getframeinfo,currentframe
> 
> class test(object):
>     def a_method(self,this,that):
>         print getframeinfo(currentframe())[2]

Thanx for the reply! This about the most useful one I've gotten so far!!

-- 
Mitko Haralanov					 mitko at qlogic.com
Senior Software Engineer			     650.934.8064
System Interconnect Group		    http://www.qlogic.com




More information about the Python-list mailing list