How to refer to the function object itself in the function per se?

Kay Schluehr kay.schluehr at gmx.net
Sat Mar 11 16:34:43 EST 2006


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




More information about the Python-list mailing list