n-dim permutation matrix/generator?

robert no-spam at no-spam-no-spam.invalid
Mon Nov 20 14:37:48 CET 2006


for the purpose of flat n-dim iteration a function or generator ndim_permute(*v) should compute or generate a list of tuples like:

ndim_permute( (0,1,2), (0,1), (0,1), ) ->
 
0 0 0
0 0 1
0 0 2
0 1 0
0 1 1
0 1 1
1 0 1
....


what is a good solution? Or is there already a total iterator existing somewhere in the stdlib?


robert



More information about the Python-list mailing list