Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ordering of dict keys when using msgspec.json.encode #825

Description

@sbalian

Question

When using msgspec.json.encode for a dictionary in Python 3.12, for example:

msgspec.json.encode({"b": 1, "a": 2})

I see that the ordering of the keys is preserved (with the default order=None). The above example returns b'{"b":1,"a":2}'. Is this order guaranteed to be the same between runs?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions