Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom dict key types in JSON #602

Merged
merged 2 commits into from
Dec 5, 2023
Merged

Support custom dict key types in JSON #602

merged 2 commits into from
Dec 5, 2023

Conversation

jcrist
Copy link
Owner

@jcrist jcrist commented Dec 5, 2023

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
8 checks passed
@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