def reverse_dict(dictionary):
    """Reverse a dictionary.

    Keys become values and vice versa.

    Parameters
    ----------
    dictionary : dict
        Dictionary to reverse

    Returns
    -------
    dict
        Reversed dictionary

    Raises
    ------
    TypeError
        If there is a value which is unhashable, therefore cannot be a dictionary key.
    """
    return {i: value for value, i in dictionary.items()}