[Python-ideas] Re: [Suspected Spam]Re: Dict unpacking assignment

2020-10-31 Thread Guido van Rossum
On Sat, Oct 31, 2020 at 21:47 Steven D'Aprano wrote: > On Sat, Oct 31, 2020 at 09:05:43PM -0700, Guido van Rossum wrote: > > > Hm, for PEP 622/634 we looked at this and ended up making it so that this > > is the default -- you only have to write > > ``` > > {'spam': spam, 'eggs': eggs} = mapping

[Python-ideas] Re: [Suspected Spam]Re: Dict unpacking assignment

2020-10-31 Thread Steven D'Aprano
On Sat, Oct 31, 2020 at 09:05:43PM -0700, Guido van Rossum wrote: > Hm, for PEP 622/634 we looked at this and ended up making it so that this > is the default -- you only have to write > ``` > {'spam': spam, 'eggs': eggs} = mapping > ``` > and any extra keys are ignored. This is because for the co

[Python-ideas] Re: [Suspected Spam]Re: Dict unpacking assignment

2020-10-31 Thread Guido van Rossum
On Sat, Oct 31, 2020 at 8:46 PM Stephen J. Turnbull < turnbull.stephen...@u.tsukuba.ac.jp> wrote: > Steven D'Aprano writes: > > > {'spam': spam, 'eggs', eggs, **who_cares} = mapping > > Shouldn't that be > > {'spam': spam, 'eggs', eggs, **_} = mapping > > 8-D > > Actually, I kinda like th

[Python-ideas] [Suspected Spam]Re: Dict unpacking assignment

2020-10-31 Thread Stephen J. Turnbull
Steven D'Aprano writes: > {'spam': spam, 'eggs', eggs, **who_cares} = mapping Shouldn't that be {'spam': spam, 'eggs', eggs, **_} = mapping 8-D Actually, I kinda like that, it looks like the side-eye emoji! Or a flounder, but that's a different kettle of fish. -- Yet Another Steve

[Python-ideas] Re: Dict unpacking assignment

2020-10-31 Thread Steven D'Aprano
On Sat, Oct 31, 2020 at 08:24:04AM +, Barry Scott wrote: > > On 31 Oct 2020, at 06:35, Steven D'Aprano wrote: > > > > I think we can promise that: > > > > * if the mapping on the right has missing keys, no assignments occur; > > > > * if the mapping on the right has extra keys, and there i

[Python-ideas] Re: Dict unpacking assignment

2020-10-31 Thread Barry Scott
> On 31 Oct 2020, at 06:35, Steven D'Aprano wrote: > > I think we can promise that: > > * if the mapping on the right has missing keys, no assignments occur; > > * if the mapping on the right has extra keys, and there is no double > star target to capture the extras, then no assignments occ