def iterable(obj):
    """ Return True if obj is iterable with a well-defined len()."""
    if hasattr(obj, '__iter__'):
        return True
    try:
        len(obj)
    except:
        return False
    return True
