On Sun, Aug 16, 2009 at 7:38 PM, Mark Lawrence <span dir="ltr"><<a href="mailto:breamoreboy@yahoo.co.uk">breamoreboy@yahoo.co.uk</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5"><br></div></div>
Blast, I posted the wrong flaming link, sorry everybody.<br>
</blockquote><div><br>No, don't be sorry. I found your link very informative, and while it's a little mixed, it could be useful.<br><br>I'm really looking for a way to set up Python classes' natural ordering for sorting purposes. For example, every object of a class could own an attribute called 'Value'. If I could get Python to sort() a list of classes with that value, would the key=value parameter work, and is there a better way than to redefine 3 or more of the rich comparison special methods, etc.<br>
<br>Also, I noticed heapq (the priority queue/heap queue module) doesn't use the natural sorting order like sorted() does. Just saying. Could someone give it a try?<br><br>Regards,<br><br clear="all">Ching-Yun "Xavier" Ho, Technical Artist<br>
<br>Contact Information<br>Mobile: (+61) 04 3335 4748<br>Skype ID: SpaXe85<br>Email: <a href="mailto:contact@xavierho.com">contact@xavierho.com</a><br>Website: <a href="http://xavierho.com/">http://xavierho.com/</a><br>
<br><br> </div></div><br>