[issue12657] Cannot override JSON encoding of basic type subclasses

Niko Wilbert report at bugs.python.org
Fri Aug 19 16:23:37 CEST 2011


Niko Wilbert <mail at nikowilbert.de> added the comment:

This issue is also a real pain when using namedtuple. In many situations a namedtuple should be serialized as a dict, but there is no reasonable way to get this behavior.

Earlier solutions (e.g., see http://stackoverflow.com/questions/5906831/serializing-a-python-namedtuple-to-json) are now broken in Python 2.7.

----------
nosy: +nikow
versions: +Python 2.7 -Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12657>
_______________________________________


More information about the Python-bugs-list mailing list