assuming the simple case where Foo is
class Foo:
def some_func(self):
print('hellow world')
I only have access to the variable func where func is :
func = Foo.some_func
I am trying to get the Foo
class name from the variable func
func
Out[6]: <function __main__.Foo.some_func>
func.__class__.__name__
Out[7]: 'function'
I am expecting to get Foo
is there anyway to do that?