c = {x: '' for x in a}
Erik Max Francis
max at alcyone.com
Fri Mar 7 04:26:44 EST 2003
Hilbert wrote:
> What's wrong with this one though? It would totally make sense to
> me...
>
> a = [1,2,3]
> c = {x: '' for x in a}
Those would be dictionary comprehensions, which aren't implemented.
There's a PEP on them somewhere.
> Where can I find documentation about "[x for x in a]"? What is it
> called?
List comprehension. Search python.org/doc for more information.
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ No one should have to dance backward all their lives.
\__/ Jill Ruckelshaus
Bosskey.net: Counter-Strike / http://www.bosskey.net/cs/
A personal guide to Counter-Strike.
More information about the Python-list
mailing list