In article <[EMAIL PROTECTED]>,
 "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:

> So - the rationale seems to be: "When using slice-assignment, a form 
> like l[a:b:c] imposes possibly a non-continous section in l, for which 
> the semantics are unclear - so we forbid it"

But it isn't forbidden:

>>> v = range(10)
>>> v
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> v[0:10:3] = ['a', 'b', 'c', 'd']
>>> v
['a', 1, 2, 'b', 4, 5, 'c', 7, 8, 'd']

The only time it's actively forbidden is when the length of the slice 
and the length of the list being assigned to it don't match.

I agree with you that it might be nice for [a:b:1] and [a:b] to be 
treated synonymously.

Dave
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to