(msg=None)
return fn
Checks whether a value is list of integers.
    Returns list of integers or just one integer in
    list if there is only one element in given CSV string.
Checks whether a value is list of integers.
    Returns list of integers or just one integer in
    list if there is only one element in given CSV string.
Checks whether a value is list of integers . Returns list of integers or just one integer in list if there is only one element in given CSV string .
def CSVofIntegers(msg=None):
    '''
    Checks whether a value is list of integers.
    Returns list of integers or just one integer in
    list if there is only one element in given CSV string.
    '''
    def fn(value):
        try:
            if isinstance(value, basestring):
                if ',' in value:
                    value = list(map(
                        int, filter(
                            bool, list(map(
                                lambda x: x.strip(), value.split(',')
                            ))
                        )
                    ))
                    return value
                else:
                    return [int(value)]
            else:
                raise ValueError
        except ValueError:
            raise Invalid(
                '<{0}> is not a valid csv of integers'.format(value)
            )
    return fn
def CSVofIntegers ( msg = None ) : def fn ( value ) : try : if isinstance ( value , basestring ) : if ',' in value : value = list ( map ( int , filter ( bool , list ( map ( lambda x : x . strip ( ) , value . split ( ',' ) ) ) ) ) ) return value else : return [ int ( value ) ] else : raise ValueError except ValueError : raise Invalid ( '<{0}> is not a valid csv of integers' . format ( value ) ) return fn