def is_iterable(x):
    try:
        iter(x)
    except TypeError:
        return False
    else:
        return True
A implementation independent way of checking for iterables
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/utils/itercompat.py/is_iterable