How to get a function name as a string?

How do I get a function's name as a string?

def foo():
    pass

>>> name_of(foo)
"foo"

← Назад к списку