python check attribute in object code example
Example 1: python3 check if object has attribute
try:
doStuff(a.property)
except AttributeError:
otherStuff()
Example 2: python check namespace has instance
if hasattr(a, 'property'):
a.property