Message383909
This core of this idea is plausible. It is a common problem for people to want to teach a class how to convert itself to and from JSON.
Altering the API for dicts is a major step, so you would need to take this to python-ideas to start getting buy-in. A much smaller API change would be to just teach the JSON module to recognize a __json__ method.
Presumably if a robust serialization solution is created, people will need a way to deserialize back into a named tuple, data class, or custom class. Offhand, the only way I can think of to do this would be to add a field that could be recognized by json.load(). Some care would be needed to not create a pickle-like risk of arbitrary code execution. |
|
Date |
User |
Action |
Args |
2020-12-28 18:01:33 | rhettinger | set | recipients:
+ rhettinger, conqp |
2020-12-28 18:01:33 | rhettinger | set | messageid: <1609178493.62.0.584389247439.issue42765@roundup.psfhosted.org> |
2020-12-28 18:01:33 | rhettinger | link | issue42765 messages |
2020-12-28 18:01:33 | rhettinger | create | |
|