John Posner wrote:
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)
Equivalent, and in fact better since the sorting is done in-place
instead of creating a new list, then overwriting the old one.
--
http://mail.python.org/mailman/listinfo/python-list