面对错误:
AttributeError: 'function' object has no attribute 'd'.
如何访问字典?
代码:
class A:
@staticmethod
def test():
d = {}
d['a'] = 'b'
print d
@staticmethod
def test1():
d1 = {}
d1['a'] = 'c'
if (A.test.d['a'] == A.test1.d1['a']):
print "yes"
else:
print "Oh No!!"
A.test()
A.test1()