sorted() erraticly fails to sort string numbers

Paddy O'Loughlin patrick.oloughlin at
Thu Apr 30 17:11:35 CEST 2009

2009/4/30 Lie Ryan <lie.1296 at>

>   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).


"Ray, when someone asks you if you're a god, you say YES!"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list