from typing import Iterable


def formatinput(val):
    """Turn strings into lists of strings, strip leading and trailing
    whitespace in strings, and ignore empty strings or any object that
    bool(obj) evaluates to False

    Parameters
    ----------
    val

    Returns
    -------
    formatted_val

    """
    if isinstance(val, str):
        val = [val]
    if isinstance(val, Iterable):
        val = [x for x in val if (x.strip() if isinstance(x, str) else x)]
    elif val is None:
        val = []
    else:
        raise ValueError('`val` type {}; `val` = "{}"'.format(type(val), str(val)))
    return val