def dict_to_sorted_str(d, _sort=True):
    """Return a str representation of dict d where keys are in ascending order.
    >>> d = {'c': 3, 'a': 1, 'b': 2}
    >>> print(dict_to_sorted_str(d))
    {'a': 1, 'b': 2, 'c': 3}
    >>> d2 = {'Z': 'zebulon', 'X': 'alphanumeric', 'Y': 'yomomma'}
    >>> print(dict_to_sorted_str(d2))
    {'X': 'alphanumeric', 'Y': 'yomomma', 'Z': 'zebulon'}
    """
    lst = list(d.items())
    if _sort:
        lst.sort(key=lambda p: p[0])
    ret = ('{' +
           ', '.join(["%s: %s" % (repr(k), repr(v)) for (k, v) in lst ]) +
           '}')
    return ret