Como verificar se uma variável contém uma referência de classe no Python

#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