It makes sense because a slice IS a list, so you should assign a list
to it.  Yours is just a special case in which the target slice has a
length of zero.  It's still a list, just an empty one:

>>> L = [1,2,4]
>>> print L[2:2]
[]

As for your question, yes:

>>> L = [1,2,4]
>>> L[2:2] = [[3]]
>>> print L
[1, 2, [3], 4]

Cheers! :)

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

Reply via email to