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, None, 3, None, 5, None, 7, None, 9]

why not accept syntax like this for extended slice

aList[::2] = None

when let's say, the left side is a list and the right side is bool, int or
float.
the laborious [nunber]*len(aList[::2]) seens to me less readable when you
want to set lost of items of a list to the same number.
Also correct me if i am wrong, calling len() and building a list to this
kind of operation seems a waste.

Just want some feedback.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to