Is there something similar to list comprehension in dict?

DreiJane joost at
Fri Nov 20 12:08:01 CET 2009

NB: I wondered about about dict(one=1, two=2) - why not d = {one:1,
two:2} ? Since you do not write L=list((1, 2)) either. These composed
objects as basic building blocks make Python code so dense and
beautiful, thus using "{}" means embracing the language's concept.

More information about the Python-list mailing list