Dictionaries aren't ordered, so there is no "original position of the elements". That said, I think you can use itertools.product
to generate all the possibilities:
>>> from itertools import product
>>> d = {'a':'','b':'2','c':'3'}
>>> poss = [(k,v) if v else (k,) for k,v in d.items()]
>>> list(product(*poss))
[('a', 'c', 'b'), ('a', 'c', '2'), ('a', '3', 'b'), ('a', '3', '2')]
where poss
describes all the choices you want to choose between for each term:
>>> poss
[('a',), ('c', '3'), ('b', '2')]
You could sort by the order of the keys, I guess:
>>> poss = [(k,v) if v else (k,) for k,v in sorted(d.items())]
>>> list(product(*poss))
[('a', 'b', 'c'), ('a', 'b', '3'), ('a', '2', 'c'), ('a', '2', '3')]