def make_hashable(variable):
    """
    Checks to see if variable is an unhashable type, and if so, converts it to
    its nearest hashable representation.  For sets, this mean conversion to a
    frozenset, for lists it means conversion to a tuple and for dictionaries it
    means conversion to a tuple of (key, value) tuples.
    
    :param variable: The original variable.
    
    :returns: The hashable form of *variable*
    """
    if isinstance(variable, set):
        return frozenset(variable)
    elif isinstance(variable, list):
        return tuple(variable)
    elif isinstance(variable, dict):
        return tuple(variable.iteritems())
    else:
        return variable
