I am sorry but you misunderstood my idea.
What I want is a generalized method to print out the function name, or
refer to the name of a function. If I use f.__name__, I think I should
just use print "f" to save my keyboard. What I expect is using a
method, or attribute, or another function to get the name of a
function.
Kay Schluehr 写道:

> Sullivan WxPyQtKinter wrote:
>
> > So how
> > could I refer to the function object per se, in the body of the
> > function itself?
>
> Just use the name.
> 
> def f():
>     print f.__name__
> 
> >>> f()
> f

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to