Python implementation of a dictionary generator.