# Test result of triple loop (too big to inline)
TRIPLETS = [(0, 0, 0), (0, 0, 1), (0, 0, 2),
            (0, 1, 0), (0, 1, 1), (0, 1, 2),
            (0, 2, 0), (0, 2, 1), (0, 2, 2),

            (1, 0, 0), (1, 0, 1), (1, 0, 2),
            (1, 1, 0), (1, 1, 1), (1, 1, 2),
            (1, 2, 0), (1, 2, 1), (1, 2, 2),

            (2, 0, 0), (2, 0, 1), (2, 0, 2),
            (2, 1, 0), (2, 1, 1), (2, 1, 2),
            (2, 2, 0), (2, 2, 1), (2, 2, 2)]


seq = range(3)
res = []
for i in iter(seq):
    for j in iter(seq):
        for k in iter(seq):
            res.append((i, j, k))
___assertEqual(res, TRIPLETS)

seq = range(3)
res = [(i, j, k) for i in seq for j in seq for k in seq]
___assertEqual(res, TRIPLETS)
