how to check if an object is a class in python code example Example: python check if class has function class A: def func(): pass hasattr(A(), 'func')