andrew c <[email protected]> added the comment:
Bob,
I understand what you are saying, but having a built-in is way easier than
encoder/decoders. You can still have both actually. Even if you didn't have
two way, a one way would be amazingly helpful. For large development systems,
a __json__ method would make serialization super easy.
class foo(object):
a = 1
b = [1,2,3]
def __json__(self): return {'a':self.a,'b':self.b}
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue35111>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com