📅  最后修改于: 2022-03-11 14:46:51.458000             🧑  作者: Mango
>>> a = A(1, 2)
>>> for name, value in a._asdict().iteritems():
print name
print value
a
1
b
2
>>> for fld in a._fields:
print fld
print getattr(a, fld)
a
1
b
2