Skip to content

Instantly share code, notes, and snippets.

@noamtm
noamtm / OrderedYAML.py
Created November 7, 2012 10:53 — forked from enaeseth/yaml_ordered_dict.py
Load YAML mappings as ordered dictionaries
import yaml
import yaml.constructor
def load(data):
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement