[Python-ideas] Unpack of sequences

Mike Graham mikegraham at gmail.com
Wed Aug 29 18:24:05 CEST 2012


On Wed, Aug 29, 2012 at 12:17 PM, Cesare Di Mauro
<cesare.di.mauro at gmail.com> wrote:
> a: x, b: y, c: z = {'a': 'x', 'b': 'y', 'c': 'z'}
>
> Cesare

"a": x, "b": y, "c": z = {'a': 'x', 'b': 'y', 'c': 'z'}

or

{"a": x, "b": y, "c": z} = {'a': 'x', 'b': 'y', 'c': 'z'}

would admit non-string keys.


IMO, a more useful thing would be attribute-based unpacking--I feel
like I do that a ton more often.

Mike



More information about the Python-ideas mailing list