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.

Author vstinner
Recipients Alex Gordon, andrewnester, berker.peksag, bob.ippolito, brett.cannon, r.david.murray, rhettinger, serhiy.storchaka, vstinner
Date 2017-02-14.13:32:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
"Add compact=True flag to json.dump/dumps"

Oh, fun, I implemented exactly this option in my perf project. Extract:

        def dump(data, fp, compact):
            kw = {}
            if compact:
                kw['separators'] = (',', ':')
                kw['indent'] = 4
            json.dump(data, fp, sort_keys=True, **kw)

So I like the idea of moving the compact=True feature directly into the json module ;-)

(I don't propose to change the default to indent=4, that's a personal choice ;-))
Date User Action Args
2017-02-14 13:32:45vstinnersetrecipients: + vstinner, brett.cannon, rhettinger, bob.ippolito, r.david.murray, berker.peksag, serhiy.storchaka, Alex Gordon, andrewnester
2017-02-14 13:32:45vstinnersetmessageid: <>
2017-02-14 13:32:44vstinnerlinkissue29540 messages
2017-02-14 13:32:44vstinnercreate