Message289001
This could fix other issues:
* issue16535 -- for Decimal.
* issue20774 -- for deque.
* issue24313 -- for NumPy numeric types.
* issue26263 -- for array.
Currently the blessed way of JSON encoder customization is to implement the default method in JSONEncoder subclass or pass the default argument to dump(). But that requires changing every JSON serialization call and handling all non-standard types in one function. I think it would be handly to pick the type-specific serialization function from: 1) per-encoder dispatch table, 2) global dispatch type (registry), 3) __json__ method. This can be done after the default function fails or be included in the default default method.
This will add JSON support of standard library types (e.g. collections other than list, tuple and dict, numbers other than int and float) and will help to implement task specific serialization of user classes. |
|
Date |
User |
Action |
Args |
2017-03-05 06:23:51 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, steven.daprano, r.david.murray, berker.peksag, abarry, Daniel Ward, Ollie Ford |
2017-03-05 06:23:51 | serhiy.storchaka | set | messageid: <1488695031.58.0.721926526929.issue27362@psf.upfronthosting.co.za> |
2017-03-05 06:23:51 | serhiy.storchaka | link | issue27362 messages |
2017-03-05 06:23:51 | serhiy.storchaka | create | |
|