getting dynamic attribute in python [duplicate]
This question already has an answer here: How to access object attribute given string corresponding to name of that attribute 2 answers I have and object with an pseudo or special attribute that can be named in three different ways (Note: I don't control the code which generates the object) The value in the attributes (depending which one is set) is exactly the same, and I need to get that for further processing, so depending of the source of data, I can have something like: >>> obj.a 'value' >>> obj.b Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: Obj