[Python-ideas] Method chaining notation

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Feb 26 22:30:49 CET 2014


Ron Adam wrote:
> Dictionaries are pretty flexible on how they are initiated, so it's 
> surprising we can't do this...
> 
>         D = dict(keys=names, values=args)

All keywords are taken by the dict(name = value, ...) constructor,
so this is not so surprising.

But you can write that as

    D = dict(zip(names, values))

-- 
Greg


More information about the Python-ideas mailing list