Python Check If Object Does Not Have Attribute