import inspect


def issequence(obj):
    """
    Test if an object is an iterable generator, list or tuple.

    Parameters
    ----------
    obj : object
        object to test

    Returns
    -------
    bool :
        True if :code:`obj` is a tuple, list or generator only.

    Examples
    --------
    >>> issequence([1, 2])
    True
    >>> issequence((1,))
    True
    >>> issequence((i for i in range(8)))
    True
    >>> issequence(np.array([1, 2, 3]))
    False
    """
    return inspect.isgenerator(obj) or isinstance(obj, (list, tuple))