John Salerno wrote:
> Steven Bethard wrote:
> 
> 
>>     lst[:] = []
>>     lst = []
> 
> 
> What's the difference here?

>>> lst = [1,2,3]
>>> lst2 = lst
>>> lst[:] = []
>>> lst2
[]
>>> lst = [1,2,3]
>>> lst2 = lst
>>> lst = []
>>> lst2
[1, 2, 3]
>>>

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

Reply via email to