How to know if an object has an attribute in Python

前端 未结 14 2353
无人及你
无人及你 2020-11-22 12:19

Is there a way in Python to determine if an object has some attribute? For example:

>>> a = SomeClass()
>>> a.someProperty = value
>>         


        
14条回答
提交回复
热议问题