def isiterable(obj):
    """Returns true of the given object is iterable."""

    # In Python2.6 and up this is simply a matter of checking isinstance
    # collections.Iterable, but this unavailable in Python 2.5 and below
    try:
        from collections import Iterable
        if isinstance(obj, Iterable):
            return True
    except __HOLE__:
        pass

    try:
        iter(obj)
        return True
    except TypeError:
        return False
dataset/ETHPy150Open spacetelescope/PyFITS/pyfits/util.py/isiterable