I want the wrapper my_function to be able to receive either a class or class instance, instead of writing two different functions:
>>> from module import MyClass
>>> my_function(MyClass)
True
>>> cls_inst = MyClass()
>>> my_function(cls_inst)
True
the problem is that I don't know in advance which type of classes or class instances I am going to receive. So I can't, for example, use functions like isinstance...
How can I type check if a param contains a class or a class instance, in a generic way?
Any idea?