This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Allows tabs for indenting JSON output
Type: enhancement Stage: patch review
Components: Library (Lib) Versions: Python 3.2
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: BreamoreBoy, bob.ippolito, doerwalter, eric.araujo, georg.brandl, r.david.murray, rhettinger
Priority: normal Keywords: patch

Created on 2009-04-09 17:15 by doerwalter, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
json.diff doerwalter, 2009-04-09 17:15
Messages (9)
msg85821 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2009-04-09 17:15
This patchs makes it possible to use tabs for indenting the output of
json.dumps(). With this patch the indent argument can now be either an
integer specifying the number of spaces per indent level or a string
specifying the indent string directly::

   json.dumps(list(range(10), indent=3) # three spaces per indent
   json.dumps(list(range(10), indent="\t") # one tab per indent
msg109841 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-07-10 10:22
Patch is small and simple, can we move this forward?
msg109901 - (view) Author: Bob Ippolito (bob.ippolito) * (Python committer) Date: 2010-07-10 17:43
Well this feature is already in simplejson 2.1.0, it would probably make more sense to simply merge the latest simplejson back with Python 3.
msg116109 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-09-11 17:20
Is this merge going to happen before 3.2 beta?
msg116119 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-09-11 21:16
That would be nice.
msg118803 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-10-15 16:54
Bob, any chance you get to that merge before 3.2b1?
msg118857 - (view) Author: Bob Ippolito (bob.ippolito) * (Python committer) Date: 2010-10-16 06:35
Sorry but I don't think I will be able to. I'd be happy to accept patches into simplejson that make it easier to merge with Python 3 in the future, but I simply do not have the time to maintain the Python 3 branch of the code that we don't use.
msg120039 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-10-31 08:00
Updated and applied in r86022.
msg137208 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-05-29 17:31
See #11964 for a documentation problem with this change.
Date User Action Args
2022-04-11 14:56:47adminsetgithub: 49979
2011-05-29 17:31:51eric.araujosetmessages: + msg137208
2010-10-31 08:00:57rhettingersetstatus: open -> closed
resolution: accepted
messages: + msg120039
2010-10-16 22:32:30rhettingersetassignee: rhettinger
2010-10-16 20:03:17pitrousetassignee: bob.ippolito -> (no value)

nosy: + rhettinger
2010-10-16 06:35:53bob.ippolitosetmessages: + msg118857
2010-10-15 16:54:25georg.brandlsetmessages: + msg118803
2010-09-11 21:30:27eric.araujosetnosy: + eric.araujo
2010-09-11 21:16:37georg.brandlsetnosy: + georg.brandl
messages: + msg116119
2010-09-11 17:20:22r.david.murraysetnosy: + r.david.murray
messages: + msg116109
2010-07-10 17:43:08bob.ippolitosetmessages: + msg109901
2010-07-10 10:22:03BreamoreBoysetnosy: + BreamoreBoy

messages: + msg109841
versions: + Python 3.2, - Python 3.1, Python 2.7
2009-04-11 08:42:48pitrousetversions: + Python 2.7
nosy: + bob.ippolito

priority: normal
assignee: bob.ippolito
stage: patch review
2009-04-09 17:15:29doerwaltercreate