This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Make PyYAML output an OrderedDict. | |
It will do so fine if you use yaml.dump(), but that generates ugly, | |
non-standard YAML code. | |
To use yaml.safe_dump(), you need the following. | |
""" | |
def represent_odict(dump, tag, mapping, flow_style=None): | |
"""Like BaseRepresenter.represent_mapping, but does not issue the sort(). |