Is there a way in Python to determine if an object has some attribute? For example:
>>> a = SomeClass() >>> a.someProperty = value >>
Here's a very intuitive approach :
if 'property' in dir(a): a.property