c# test to make sure attribute exists on object code example Example: python check if has attribute if hasattr(a, 'property'): a.property