def _deep_tuple(item):
    """
    Convert a nested list with arbitrary structure to a nested _tuple_ instead.
    """
    if isinstance(item, list):
        # In the recursive case (item is a list), recursively deep_tuple-ify all 
        # list items, and store all items in a tuple intead.
        return tuple(_deep_tuple(i) for i in item)
    else:
        # In the base case (any items that are not lists, including some 
        # possibly deep objects like dicts, and tuples themselves), change 
        # nothing.
        return item