from itertools import izip_longest as izip_l, chain
config = {'A': 3, 'B': 4, 'C': 2}
# Reconstruct the list of lists
expanded = [[k] * config[k] for k in config]
# Just zip them and ignore the None
print[item for item in chain.from_iterable(izip_l(*expanded)) if item]
If the count is too big and if you are worried about the performance and the memory consumed, you can use repeat
instead of reconstructing the list of lists, like this
from itertools import izip_longest as izip_l, chain, repeat
expanded = [repeat(k, config[k]) for k in config]
Rest all are the same