Fairly straightforward, I have a method that takes another function as input and gives the class that the input belongs to. I have this inelegant way of getting the parent class' name, but not the class itself.
class the_class:
def method(...):
pass
def what_class(func):
# trying to access '<function the_class.method at [address]>'
print(str(func).split()[1].split('.')[0])
>> the_class
I'd like to know how to return an instance of func's parent class through what_class, instead of only getting the string.