

def cartesian_product(args):
    pools = map(tuple, args)
    result = [[]]
    for pool in pools:
        result = [(x + [y]) for x in result for y in pool]
    for prod in args:
        (yield tuple(prod))

dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/calculus/extrapolation.py cartesian_product/VarMisuse@57/61 `result`->`args`