(value)
return [value]
Returns ``value`` as a list if it is iterable and not a string,
    otherwise returns ``value`` in a list.

    >>> to_list(('foo', 'bar', 'baz'))
    ['foo', 'bar', 'baz']
    >>> to_list('foo bar baz')
    ['foo bar baz']
Returns ``value`` as a list if it is iterable and not a string,
    otherwise returns ``value`` in a list.
Returns value as a list if it is iterable and not a string otherwise returns value in a list .
def to_list(value):
    """
    Returns ``value`` as a list if it is iterable and not a string,
    otherwise returns ``value`` in a list.

    >>> to_list(('foo', 'bar', 'baz'))
    ['foo', 'bar', 'baz']
    >>> to_list('foo bar baz')
    ['foo bar baz']

    """
    if hasattr(value, '__iter__') and not isinstance(value, str):
        return list(value)
    return [value]
def to_list ( value ) : if hasattr ( value , '__iter__' ) and not isinstance ( value , str ) : return list ( value ) return [ value ]