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

dict vs OrderedDict #34

Open
justvanrossum opened this issue Jan 17, 2025 · 0 comments · May be fixed by #35
Open

dict vs OrderedDict #34

justvanrossum opened this issue Jan 17, 2025 · 0 comments · May be fixed by #35

Comments

@justvanrossum
Copy link

It looks like dump[s] makes a distinction between dict instances and OrderedDict instances: for dict it sorts the keys before serializing.

I bet this code predates the preserve-insertion-order of Python dicts.

It would be useful to have a dump option like json.dump[s]: sort_keys, that we can set to False if we prefer the dict's order to be preserved.

(I might try to PR this, but I'm not familiar with the code base.)

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 a pull request may close this issue.

1 participant