2009/4/30 Lie Ryan <lie.1...@gmail.com>

>   container[:] = sorted(container, key=getkey)
>>
>> .... is equivalent to:
>>
>>   container.sort(key=getkey)
>>
>>
> Equivalent, and in fact better since the sorting is done in-place instead
> of creating a new list, then overwriting the old one.


Not when, as pointed out by uuid, container is not list-like (at least as
far as the sort() method goes).
:)

Paddy

-- 
"Ray, when someone asks you if you're a god, you say YES!"
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to