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