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