From 0aafc46bd6008b32fb9dd51e39bf0c63b1ecfe76 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 2 Sep 2009 15:19:51 -0400 Subject: [PATCH] clarify json indent explanation --- serializing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/serializing.html b/serializing.html index 26e28a4..d18ef40 100644 --- a/serializing.html +++ b/serializing.html @@ -353,7 +353,7 @@ def protocol_version(file_object): >>> with open('basic-pretty.json', mode='w', encoding='utf-8') as f: ... json.dump(basic_entry, f, indent=2)
    -
  1. If you pass an indent parameter to the json.dump() function, it will make the resulting JSON file more readable, at the expense of larger file size. The indent parameter is an integer. 0 means “put each value on its own line.” A number greater than 0 means “put each value on its own line, and indent that many spaces.” +
  2. If you pass an indent parameter to the json.dump() function, it will make the resulting JSON file more readable, at the expense of larger file size. The indent parameter is an integer. 0 means “put each value on its own line.” A number greater than 0 means “put each value on its own line, and use this number of spaces to indent nested data structures.”

And this is the result: