Skip to content

Support custom dict key types in JSON - #602

Merged
jcrist merged 2 commits into
mainfrom
custom-dict-key-json
Dec 5, 2023
Merged

jcrist merged 2 commits into
mainfrom
custom-dict-key-json

Conversation

@jcrist

@jcrist jcrist commented Dec 5, 2023 •

Copy link
Copy Markdown
Member

This adds support for encoding/decoding custom types when used as dict keys in the JSON encoder/decoder. Previously the JSON implementation failed to fallback to enc_hook/dec_hook for custom dict keys.

Fixes #568.

Previously the JSON encoder wouldn't fallback to `enc_hook` when
encoding dicts with custom key types.
@jcrist
jcrist merged commit 330c00d into main Dec 5, 2023
@jcrist
jcrist deleted the custom-dict-key-json branch December 5, 2023 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Thanks to encoding hooks, why not supporting arbitrary objects as dict keys?

1 participant