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 Erwin Mayer
Recipients Erwin Mayer, berker.peksag, bob.ippolito, cvrebert, docs@python, ezio.melotti, july, pitrou, rhettinger, serhiy.storchaka
Date 2016-04-08.12:41:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460119294.28.0.857451806495.issue18820@psf.upfronthosting.co.za>
In-reply-to
Content
Regarding the issues mentioned in https://github.com/simplejson/simplejson/issues/77, they already apply with the current implementation anyway (true is serialized as 'true'), so users must already be careful.

The JSONEncoder with default parameters could definitely keep rejecting complex keys, but an optional 'encode_complex_keys=False' parameter could be added to __init__ to provide this functionality. There would be zero performance impact as the parameter check would only be done if all else has failed instead of raising the TypeError (the same way _skipkeys does).

In that respect, the patch of this issue would need to be amended (and the C version would also need to be changed).

I am trying to fork the json core module to achieve this (to not have to wait for the next Python release, assuming it gets implemented), if you are familiar with the packaging process of core modules into standalone modules, your advice would be much appreciated (and could well help others contribute to Python):
http://stackoverflow.com/questions/36498527/how-to-create-a-customized-version-of-a-core-python-module-that-includes-c-code
History
Date User Action Args
2016-04-08 12:41:34Erwin Mayersetrecipients: + Erwin Mayer, rhettinger, bob.ippolito, pitrou, ezio.melotti, cvrebert, july, docs@python, berker.peksag, serhiy.storchaka
2016-04-08 12:41:34Erwin Mayersetmessageid: <1460119294.28.0.857451806495.issue18820@psf.upfronthosting.co.za>
2016-04-08 12:41:34Erwin Mayerlinkissue18820 messages
2016-04-08 12:41:33Erwin Mayercreate