itertools.permutations() does what I'm looking for, I just need to pad the list with blanks if it has fewer than N values and specify N as the max permutation length. Thanks to John and Copperfield for pointing me in the right direction.