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 <1487079165.0.0.219611801051.issue29540@psf.upfronthosting.co.za>
In-reply-to
Content
"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'] = (',', ':')
            else:
                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 ;-))
History
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: <1487079165.0.0.219611801051.issue29540@psf.upfronthosting.co.za>
2017-02-14 13:32:44vstinnerlinkissue29540 messages
2017-02-14 13:32:44vstinnercreate