[issue41569] json.JSONEncoder.default should be called for dict keys as well

2021-12-29 Thread Andrei Kulakov
Change by Andrei Kulakov : -- nosy: +kj resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> json.dump() ignores its 'default' option when serializing dictionary keys ___ Python tracker

[issue41569] json.JSONEncoder.default should be called for dict keys as well

2020-08-17 Thread David Byrne
New submission from David Byrne : 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)