Re: [Python-ideas] Default values in multi-target assignment

2018-04-12 Thread Serhiy Storchaka
12.04.18 18:12, Guido van Rossum пише: I hear where you're coming from but I really don't think we should do this. If you don't have the right expectation already it's hard to guess what it means. I would much rather spend effort on a proper matching statement. There are few applications of t

Re: [Python-ideas] Default values in multi-target assignment

2018-04-12 Thread Guido van Rossum
I hear where you're coming from but I really don't think we should do this. If you don't have the right expectation already it's hard to guess what it means. I would much rather spend effort on a proper matching statement. On Thu, Apr 12, 2018 at 2:54 AM, Serhiy Storchaka wrote: > Yet one crazy

Re: [Python-ideas] Default values in multi-target assignment

2018-04-12 Thread Clint Hepner
> On 2018 Apr 12 , at 5:54 a, Serhiy Storchaka wrote: > > Yet one crazy idea. What if allow default values for targets in multi-target > assignment? > >>>> (a, b=0) = (1, 2) >>>> a, b >(1, 2) >>>> (a, b=0) = (1,) >>>> a, b >(1, 0) >>>> (a, b=0) = () >Traceback (

[Python-ideas] Default values in multi-target assignment

2018-04-12 Thread Serhiy Storchaka
Yet one crazy idea. What if allow default values for targets in multi-target assignment? >>> (a, b=0) = (1, 2) >>> a, b (1, 2) >>> (a, b=0) = (1,) >>> a, b (1, 0) >>> (a, b=0) = () Traceback (most recent call last): File "", line 1, in ValueError: not e