So überprüfen Sie, ob eine Variable eine Klassenreferenz in Python enthält
#how to check if a variable holds a class reference, if it is an instance
#or a function or a method in python
import inspect
class cls:
pass
print(inspect.isclass(cls))
>True
instance = cls()
print(issinstance(instance, cls))
>True
print(inspect.isclass(instance))
>False
#you can also use
#inspect.isfunction(function_name)
#inspect.ismethod(method_name)
motinxy