check if a class has a property python code example
Example 1: python hasattribute
hasattr(object, name)
Example 2: python3 check if object has attribute
try:
doStuff(a.property)
except AttributeError:
otherStuff()
hasattr(object, name)
try:
doStuff(a.property)
except AttributeError:
otherStuff()