This commit is contained in:
Mark Pilgrim
2009-08-09 20:01:05 -07:00
parent f5c8b0b61a
commit 69728095d4
+2 -2
View File
@@ -40,10 +40,10 @@ if __name__ == '__main__':
print(type(entry2['tags']))
with open('entry.json', 'w', encoding = 'utf-8') as f:
json.dump(entry, f, default = custom_encoder)
json.dump(entry, f, default = to_json)
with open('entry.json', 'r', encoding = 'utf-8') as f:
entry2 = json.load(f, object_hook = custom_decoder)
entry2 = json.load(f, object_hook = from_json)
print(entry == entry2)
print(type(entry['tags']))