(fields, delimiter=',')
return [fields[x + 1:y] for (x, y) in zip(commas, commas[1:])]
Returns list of (0-depth) fields splitted by delimiter

    >>> splitFields('foo, bar, max(foo, bar)')
    ['foo', 'bar', 'max(foo,bar)']
Returns list of (0-depth) fields splitted by delimiter
Returns list of ( 0 - depth ) fields splitted by delimiter
def splitFields(fields, delimiter=','):
    """
    Returns list of (0-depth) fields splitted by delimiter

    >>> splitFields('foo, bar, max(foo, bar)')
    ['foo', 'bar', 'max(foo,bar)']
    """

    fields = fields.replace("%s " % delimiter, delimiter)
    commas = [-1, len(fields)]
    commas.extend(zeroDepthSearch(fields, ','))
    commas = sorted(commas)

    return [fields[x + 1:y] for (x, y) in zip(commas, commas[1:])]
def splitFields ( fields , delimiter = ',' ) : fields = fields . replace ( "%s " % delimiter , delimiter ) commas = [ - 1 , len ( fields ) ] commas . extend ( zeroDepthSearch ( fields , ',' ) ) commas = sorted ( commas ) return [ fields [ x + 1 : y ] for ( x , y ) in zip ( commas , commas [ 1 : ] ) ]