On Fri, Oct 23, 2020, 5:41 AM Alex Hall <[email protected]> wrote:

> On Fri, Oct 23, 2020 at 11:10 AM Steven D'Aprano <[email protected]>
> wrote:
>
>> > but that doesn't make it make sense to write `... = **values` as you
>> > suggest.
>>
>> Iterator unpacking on a dict already works:
>>
>>     py> d = {'a': 10, 'b': 20}
>>     py> spam, eggs = d
>>     py> spam, eggs
>>     ('a', 'b')
>>
>> so we need to distinguish the iterator unpacking case from the dict
>> unpacking case.
>
>
> I understand that, I just don't think this particular method of
> distinguishing is sufficiently justified.
>
> (Heretical question: do we *really* need to distinguish it in syntax?
> Iterator unpacking a dict seems like a dumb idea, I wouldn't be sad if we
> broke compatibility there)
>

I would join you in this heresy. This has never made any sense to me. And
the fix is easy:

spam, eggs = d.keys()
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/3VRD2LK6F25DQI4LP7XSWCCX6QIALAJF/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to