Karthikeyan Singaravelan <tir.kar...@gmail.com> added the comment:

https://docs.python.org/3/library/json.html#json.JSONEncoder

> To extend this to recognize other objects, subclass and implement a default() 
> method with another method that returns a serializable object for o if 
> possible, otherwise it should call the superclass implementation (to raise 
> TypeError).

default is called only when the object cannot be serialized by default. In this 
case dict is serializable and default won't be called.

----------
nosy: +ezio.melotti, rhettinger, xtreak

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40475>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to