import itertools


def rangeX(iterations):
    """
    Multidimensional iterator using all possible combinations within the given
    boundaries e.g. rangeX((2,3)) => 00 01 02 10 11 12
    """
    if not isinstance(iterations, (tuple)):
        raise AttributeError
    return itertools.product(*map(range, iterations))