from typing import Mapping


def reverse_dict(d: Mapping):
    """A dict obtained from the input mapping by inverting keys and values

    >>> reverse_dict({1: 'one', 3: 'three'})
    {'one': 1, 'three': 3}
    """
    return {v: k for k, v in d.items()}