[Python-ideas] It would be great if the json module would allow and clear existing comments.

João Matos jcrmatos at gmail.com
Thu Dec 13 07:23:45 EST 2018


Comments in JSON files are a great way to document a configuration file for 
Even JSON's Douglas Crockford agrees that it is a helpful thing and it 
suggests using JSMin before handing it to the JSON parser in here

So, I would like to suggest adding that feature do the json module.
A simple boolean argument, clear_comments, with the default False to keep 
previous compatibility.
With the clear_comments=True and following JSMin "rules", comments in the 
// form should be replaced with linefeeds and comments in the /* */ form 
with spaces.

Best regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20181213/1c4e06b3/attachment.html>

More information about the Python-ideas mailing list