strictyaml
strictyaml copied to clipboard
Use only ordinary dicts in python >= 3.7
Starting in python 3.7 all dicts are guaranteed to maintain order:
https://mail.python.org/pipermail/python-dev/2017-December/151283.html
OrderedDict is thus unnecessary, although still necessary for any version of python below 3.7.
Drawbacks
- Backwards compatibility: if type(parsed) used to get OrderedDict then upgrades of python may subsequently fail.
- ???
Benefits
- repr of a dict looks a bit nicer
- ???
Backwards compatibility: if type(parsed) used to get OrderedDict then upgrades of python may subsequently fail.
Combining with issue #90 ("Support for type hints"): returning dict
for load(..., List[Dict])
and OrderedDict
for load(..., Seq(Map()))
would be backwards compatible.