如何知道對象在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在使用之前?
請問 如何知道對象在Python中是否具有屬性
慕桂英3389331
2019-09-03 04:00:58