def is_generator(iterable):
    """
    Check if an iterable is a generator.

    Args:
        iterable: Iterable.

    Returns:
        boolean
    """
    return hasattr(iterable, '__iter__') and not hasattr(iterable, '__len__')