[issue30343] Subclassed json.JSONEncoder does not respect default method for supported types

2020-10-19 Thread Éric Araujo
Éric Araujo added the comment: See also https://bugs.python.org/issue34858 This needs a discussion on python-ideas or -dev. -- nosy: +eric.araujo ___ Python tracker ___

[issue30343] Subclassed json.JSONEncoder does not respect default method for supported types

2017-05-12 Thread Christopher Harrison
Christopher Harrison added the comment: I have written a proof-of-concept implementation and submitted a pull request. See the PR for details: https://github.com/python/cpython/pull/1558 (My CLA is pending; submitted around 2017-05-12T10:30:00Z+0100) --

[issue30343] Subclassed json.JSONEncoder does not respect default method for supported types

2017-05-12 Thread Christopher Harrison
Changes by Christopher Harrison : -- pull_requests: +1654 ___ Python tracker ___ ___

[issue30343] Subclassed json.JSONEncoder does not respect default method for supported types

2017-05-11 Thread Christopher Harrison
New submission from Christopher Harrison: If you subclass `json.JSONEncoder` to enable serialisation of custom types beyond those supported, you are meant to transform values of said type into a serialisable version within an overridden `default` method. For example: class