> tObj = InstitutionRecord() tObj.ROFields = [] > tObj.ROFields.append(msgROField()) > tObj.ROFields[0].Name = 'Value 1' > tObj.ROFields[0].Value = 3.14 > > ...Python says that the NoneType does not have an append method on the > second line. > > Any ideas? This is Python 2.4.
See the line I inserted. Fields in Thrift structures in Python all default to None (the absence of a meaningful value) rather than "empty" values (like 0 or the empty list) unless a default is declared explicitly in the .thrift file, as in 5: list<msgROField> ROFields = [];
