def ensure_list(var):
    """Ensure var is list or tuple.

    Especially useful to avoid character iteration over strings.
    """
    if not var:
        return []
    return var if type(var) in [list, tuple] else [var]