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
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
I would be very interested in a logical explanation why this happens on
python 2.5.1:
In order to sort an etree by the .text value of one child, I adapted
this snippet from effbot.org:
import xml.etree.ElementTree as ET
tree = ET.parse(data.xml)
def getkey(elem):
return
On Tue, Apr 28, 2009 at 9:47 AM, uuid m8r-r1c6...@mailinator.com wrote:
I would be very interested in a logical explanation why this happens on
python 2.5.1:
In order to sort an etree by the .text value of one child, I adapted this
snippet from effbot.org:
import xml.etree.ElementTree as ET
I am at the same time impressed with the concise answer and
disheartened by my inability to see this myself.
My heartfelt thanks!
On 2009-04-28 10:06:24 +0200, Andre Engels andreeng...@gmail.com said:
When sorting strings, including strings that represent numbers,
sorting is done
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:
On 2009-04-28 16:18:43 +0200, John Posner jjpos...@snet.net said:
Don't be disheartened! Many people -- myself included, absolutely! --
occasionally let a blind spot show in their messages to this list.
Thanks for the encouragement :)
BTW:
container[:] = sorted(container, key=getkey)