[Python-ideas] List assignment - extended slicing inconsistency

2018-02-22 Thread Alexander Heger
​What little documentation I could find, providing a stride on the assignment target for a list is supposed to trigger 'advanced slicing' causing element-wise replacement - and hence requiring that the source iterable has the appropriate number of elements. >>> a = [0,1,2,3] >>> a[::2] = [4,5] >>>

Re: [Python-ideas] List assignment - extended slicing inconsistency

2018-02-22 Thread Guido van Rossum
On Thu, Feb 22, 2018 at 2:18 PM, Alexander Heger wrote: > ​What little documentation I could find, providing a stride on the > assignment target for a list is supposed to trigger 'advanced slicing' > causing element-wise replacement - and hence requiring that the source > iterable has the appropr

Re: [Python-ideas] List assignment - extended slicing inconsistency

2018-02-22 Thread Nick Coghlan
On 23 February 2018 at 11:51, Guido van Rossum wrote: > On Thu, Feb 22, 2018 at 2:18 PM, Alexander Heger wrote: >> But I disagree that there should be no error when it is wrong. >> *Strides that are not None should always trigger advanced slicing.* > > This makes sense. > > (I wonder if the discr