Generator for constant intervals.

    Args:
        interval: A constant value to yield or an iterable of such values.

def constant(interval=1):
    """Generator for constant intervals.

    Args:
        interval: A constant value to yield or an iterable of such values.
    """
    try:
        itr = iter(interval)
    except TypeError:
        itr = itertools.repeat(interval)

    for val in itr:
        yield val