sorted() erraticly fails to sort string numbers
John Posner
jjposner at snet.net
Tue Apr 28 10:18:43 EDT 2009
uuid wrote:
> I am at the same time impressed with the concise answer and
> disheartened by my inability to see this myself.
> My heartfelt thanks!
Don't be disheartened! Many people -- myself included, absolutely! --
occasionally let a blind spot show in their messages to this list. BTW:
container[:] = sorted(container, key=getkey)
... is equivalent to:
container.sort(key=getkey)
(unless I'm showing *my* blind spot here)
More information about the Python-list
mailing list