如何知道對象在Python中是否具有屬性Python中是否有確定對象是否具有某種屬性的方法?例如:>>> a = SomeClass()>>> a.someProperty = value>>> a.propertyTraceback (most recent call last):
File "<stdin>", line 1, in <module>AttributeError: SomeClass instance has no attribute 'property'你怎么知道a有屬性property在使用之前?
添加回答
舉報
0/150
提交
取消