a question on the new dict() keyword argument syntax

Oktay Safak oktaysafak at ixir.com
Sat Aug 2 01:01:23 CEST 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