Finding a function name

Tim Williams listserver at tdw.net
Fri Aug 6 18:18:29 CEST 2004


[ 1 step up from Newbie ]

How can I find a function's name from within the function?

>>> print container.trailing_period.__name__
trailing_period

>>> print container.trailing_period.func_name
trailing_period

but from within the function itself,   print (either option) gives
"container"

TIA




More information about the Python-list mailing list