[Python-ideas] Unpacking a dict

Paul Moore p.f.moore at gmail.com
Mon May 30 11:23:30 EDT 2016


On 30 May 2016 at 16:07, Nikolaus Rath <Nikolaus at rath.org> wrote:
> Yeah, but that might be useful too :-). How about:
>
> extract key foo from d
> extract attribute foo import d
>
> or
>
> export key foo from d
> export attribute foo import d
>
> As for "import", with both foo and d required to be identifiers.

At this point, the question has to be, how is this any better than

foo = d.foo
foo = d['foo']

???

Paul


More information about the Python-ideas mailing list