a dictionary from a list

Scott David Daniels Scott.Daniels at Acm.Org
Sat Jun 25 12:44:08 EDT 2005


Roy Smith wrote:
> Terry Hancock <hancock at anansispaceworks.com> wrote:
> ...
> I just re-read the documentation on the dict() constructor.  Why does it 
> support keyword arguments?
> 
>    dict(foo="bar", baz="blah") ==> {"foo":"bar", "baz"="blah"}
> 
> This smacks of creeping featurism.  Is this actually useful in real code?
Yes it's useful, and it grew organically from the keyword arg syntax.
No new syntax was introduced to provide this; the existing syntax was
used.

--Scott David Daniels
Scott.Daniels at Acm.Org




More information about the Python-list mailing list