Ensure that a value is iterable and not some sort of string

def _is_iterable(val):
    """Ensure that a value is iterable and not some sort of string"""
    try:
        iter(val)
    except (ValueError, TypeError):
        return False
    else:
        return not isinstance(val, basestring)