itertools.permutations
あなたが探しているものだと思います。
>>> import itertools
>>> l = [1,2,3],[4,5,6],[7,8,9]
>>> list(itertools.permutations(l, len(l)))
[([1, 2, 3], [4, 5, 6], [7, 8, 9]),
([1, 2, 3], [7, 8, 9], [4, 5, 6]),
([4, 5, 6], [1, 2, 3], [7, 8, 9]),
([4, 5, 6], [7, 8, 9], [1, 2, 3]),
([7, 8, 9], [1, 2, 3], [4, 5, 6]),
([7, 8, 9], [4, 5, 6], [1, 2, 3])]
そして一緒にマージしました:
>>> [list(itertools.chain(*x)) for x in itertools.permutations(l, len(l))]
[[1, 2, 3, 4, 5, 6, 7, 8, 9],
[1, 2, 3, 7, 8, 9, 4, 5, 6],
[4, 5, 6, 1, 2, 3, 7, 8, 9],
[4, 5, 6, 7, 8, 9, 1, 2, 3],
[7, 8, 9, 1, 2, 3, 4, 5, 6],
[7, 8, 9, 4, 5, 6, 1, 2, 3]]