Get the name of a function

gervaz gervaz at gmail.com
Fri Aug 5 20:52:23 CEST 2011


Hi all, is there a way to retrive the function name like with
self.__class__.__name__?

Using self.__dict__.__name__ I've got

>>> def test():
...     print(self.__dict__.__name__)
...
>>> test
<function test at 0x0178DDF8>

But I really just want the function name, so 'test'

Any help?

Thanks,

Mattia



More information about the Python-list mailing list