On Thu, Feb 01, 2018 at 08:45:13PM +0000, Kiss, György wrote:
Most of the classes (even if very simple like datetime.datetime) cannot be serialized to JSON by default.
Would it be a good idea for the default json.JSONEncoder to call the __json__ dunder method automatically if the object has one? I can't find anything about why this protocol or PEP doesn't exists yet.
This has been discussed before:
Please familiarise yourself with the objections and counter-arguments already discussed before trying to debate this again.