Ticket #23 (closed enhancement: fixed)
Dictionary output not sorted.
|Reported by:||tim.hochberg@…||Owned by:||xi|
It is convenient to have YAML's output be consistent across runs. Some representers in PyYaml? do this already, but the dictionaries do not. I implemented a quick fix by replacing represent_dict with:
def represent_dict(self, data): items = data.items() items.sort() return self.represent_mapping(u'tag:yaml.org,2002:map', items)
It might also be convenient to have custom sort orders as PyYaml? legacy does, but that's a bigger change.