Message375561
Sub-classing and overriding json.JSONEncoder.default allows users to create custom serialisation for objects that can’t otherwise be serialized. However, this method is only called for dictionary values such that dictionary supported keys (i.e. hashable types) can not be fully utilized. Calling .default on keys as well as values allows users to to fully utilize json for all dict supported types.
See https://stackoverflow.com/questions/63393059/json-dump-not-calling-default-or-cls for example |
|
Date |
User |
Action |
Args |
2020-08-17 17:42:21 | david.byrne222 | set | recipients:
+ david.byrne222 |
2020-08-17 17:42:21 | david.byrne222 | set | messageid: <1597686141.71.0.298355570835.issue41569@roundup.psfhosted.org> |
2020-08-17 17:42:21 | david.byrne222 | link | issue41569 messages |
2020-08-17 17:42:21 | david.byrne222 | create | |
|