def _config_split(value, delim, cast=None):
    """Splits the specified value using `delim` and optionally casting the
    resulting items.

    Args:
        value (str): config option to split.
        delim (str): string to split the option value on.
        cast (function): to apply to each item after the split operation.
    """
    if value is None:
        return
    
    if delim is None: # pragma: no cover
        vals = value.split()
    else:
        vals = value.split(delim)
        
    if cast is not None:
        return list(map(cast, vals))
    else:
        return vals