Skip to content

Dumping Python dict yields invalid HSD #7

Description

@awvwgk

Since keys in Python dicts are case sensitive, one can easily build a dict that has no valid HSD representation. Unfortunately, this is exactly what happens with the implementation in this repo:

>>> import hsd
>>> print(hsd.dumps({'key': 0.0, 'Key': 1.0}))
key = 0.0
Key = 1.0

The preferable solution would be an exception from the serializer or a way to normalize a dict for HSD dumping.

Together with #6, the deserialization of the above HSD then yields {'key': [0.0, 1.0]}, so it cannot even be identified as invalid HSD.

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