how to check the presence of a class object in a list in python code example Example: python check if has attribute if hasattr(a, 'property'): a.property