Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Chris Rebert
On Fri, Jul 2, 2010 at 7:19 PM, Robert William Hanks wrote: > to say is "wrong" i think is a bit too much, its just a different type of > usage, this type of sintax is extensively used in numpy arrays (extended > slice came from numerical python), just asking why not extend the sintax to > python

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Robert William Hanks
on managing the list at >python-list-ow...@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Python-list digest..." > > Today's Topics: > > 1. Re: Why defaultdict? (Steven D'Aprano) > 2.

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread MRAB
Robert William Hanks wrote: why pure python don't support "extended slice direct assignment" for lists? today we have to write like this, >>> aList=[0,1,2,3,4,5,6,7,8,9] >>> aList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> aList[::2]= [None]*len(aList[::2]) #or do the math by hand, what's not alwa

Re: why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Shashwat Anand
On Sat, Jul 3, 2010 at 4:54 AM, Robert William Hanks < astroultra...@gmail.com> wrote: > why pure python don't support "extended slice direct assignment" for lists? > > today we have to write like this, > > >>> aList=[0,1,2,3,4,5,6,7,8,9] > >>> aList > [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] > >>> aList[::

why python don't support "extended slice direct assignment" for lists?

2010-07-02 Thread Robert William Hanks
why pure python don't support "extended slice direct assignment" for lists? today we have to write like this, >>> aList=[0,1,2,3,4,5,6,7,8,9] >>> aList [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> aList[::2]= [None]*len(aList[::2]) #or do the math by hand, what's not always possible >>> aList [None, 1, No