如何确定一个对象是否含有某个属性?

if hasattr(a, 'property'):
    a.property

猜你喜欢

转载自blog.csdn.net/countofdane/article/details/84140988