From c2ac57221c8a18d01cef9eefb376081ecc3cb3b0 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 2 Sep 2009 15:26:55 -0400 Subject: [PATCH] added missing stream object in json.dump examples --- serializing.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serializing.html b/serializing.html index 64f542f..2f6ec3a 100644 --- a/serializing.html +++ b/serializing.html @@ -474,7 +474,7 @@ def protocol_version(file_object): 1 >>> import customserializer >>> with open('entry.json', 'w', encoding='utf-8') as f: -... json.dump(entry, default=customserializer.to_json) +... json.dump(entry, f, default=customserializer.to_json) ... Traceback (most recent call last): File "<stdin>", line 9, in <module> @@ -521,7 +521,7 @@ def to_json(python_object): >>> shell 1 >>> with open('entry.json', 'w', encoding='utf-8') as f: -... json.dump(entry, default=customserializer.to_json) +... json.dump(entry, f, default=customserializer.to_json) ...