def validate_stringlist ( s ) : if isinstance ( s , six . string_types ) : return [ six . text_type ( v . strip ( ) ) for v in s . split ( ',' ) if v . strip ( ) ] else : try : return list ( map ( validate_str , s ) ) except TypeError as e : raise ValueError ( e . message )
python string of list of string
Validate a list of strings
def validate_stringlist(s):
    """Validate a list of strings

    Parameters
    ----------
    val: iterable of strings

    Returns
    -------
    list
        list of str

    Raises
    ------
    ValueError"""
    if isinstance(s, six.string_types):
        return [six.text_type(v.strip()) for v in s.split(',') if v.strip()]
    else:
        try:
            return list(map(validate_str, s))
        except TypeError as e:
            raise ValueError(e.message)