[issue27362] json.dumps to check for obj.__json__ before raising TypeError

Emanuel Barry report at bugs.python.org
Tue Jun 21 09:53:25 EDT 2016


Emanuel Barry added the comment:

So __json__ returns a string meant to be serializable. I'm not too keen on using a dunder name (although my word doesn't weigh anything ;) and I'd personally prefer something like as_json_string(). I think the idea in general is good, though. Mind submitting a patch?

----------
stage: test needed -> needs patch

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


More information about the Python-bugs-list mailing list