[Python-3000] Set literal

Guido van Rossum guido at python.org
Sat Feb 2 01:45:33 CET 2008


On Feb 1, 2008 4:07 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Not necessarily. We don't have dict comprehensions, and

We don't?

bash-3.2$ ./python.exe
Python 3.0a2+ (py3k:60207, Jan 22 2008, 16:58:59)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> {x:x**2 for x in range(10)}
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81}
>>>

Where have you been? :-)


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list