def is_iter(y, ignore=six.string_types):

    if ignore and isinstance(y, ignore):
        return False
    try:
        iter(y)
        return True
    except TypeError:
        return False
Test if an object is iterable, but not a string type.
dataset/ETHPy150Open saltstack/salt/salt/utils/__init__.py/is_iter