sorted() erraticly fails to sort string numbers

uuid M8R-r1c6h51 at mailinator.com
Tue Apr 28 10:38:10 EDT 2009


On 2009-04-28 16:18:43 +0200, John Posner <jjposner at 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)
> 
> ... is equivalent to:
> 
>     container.sort(key=getkey)
> 
> (unless I'm showing *my* blind spot here)

I don't think etree element objects support the .sort method.
At least in lxml they don't 
(http://codespeak.net/lxml/api/elementtree.ElementTree.Element-class.html) 





More information about the Python-list mailing list