a question on the new dict() keyword argument syntax

Oktay Safak oktaysafak at ixir.com
Fri Aug 1 19:01:23 EDT 2003


Hi,

Is there an equivalent keyword argument syntax for these cases:

d1 = {1:"one"}

d2 = {"1":"one"}

these don't work, of course:

>>> a = dict(1 = "one")
SyntaxError: keyword can't be an expression

>>> a = dict("1" = "one")
SyntaxError: keyword can't be an expression

Just curious...




More information about the Python-list mailing list