def is_iterable(maybe_iter, unless=(dict)):
    """ Return whether ``maybe_iter`` is an iterable, unless it's an instance of one
    of the base class, or tuple of base classes, given in ``unless``.

    Example::

        >>> is_iterable('foo')
        False
        >>> is_iterable(['foo'])
        True
        >>> is_iterable(['foo'], unless=list)
        False
        >>> is_iterable(xrange(5))
        True
    """
    if isinstance(maybe_iter, str):
        return False
    try:  # pragma: no cover
        iter(maybe_iter)
    except TypeError:  # pragma: no cover
        return False
    return not isinstance(maybe_iter, unless)