def _stable_dict_repr(strdict):
    """Return a repr() for a dict keyed by a string, in sorted key order"""
    lines = []
    for key in sorted(strdict.keys()):
        lines.append("%r: %r" % (key, strdict[key]))
    return "{%s}" % ", ".join(lines)