python check if class has variable code example Example: python check if class has function class A: def func(): pass hasattr(A(), 'func')