Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Ian Kelly
On Thu, Feb 24, 2011 at 9:41 AM, Jeremy wrote: > I recently found the wiki page on sorting > (http://wiki.python.org/moin/HowTo/Sorting/).  This page describes the new > key parameter to the sort and sorted functions. > > What about custom objects?  Can I just write __lt__, __gt__, etc. function

Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Chris Rebert
On Thu, Feb 24, 2011 at 8:41 AM, Jeremy wrote: > I recently found the wiki page on sorting > (http://wiki.python.org/moin/HowTo/Sorting/).  This page describes the new > key parameter to the sort and sorted functions. > > What about custom objects?  Can I just write __lt__, __gt__, etc. function

Re: Preferred method of sorting/comparing custom objects

2011-02-24 Thread Jeremy
Sorry for double posting. Google Groups was acting funny this morning. -- http://mail.python.org/mailman/listinfo/python-list

Preferred method of sorting/comparing custom objects

2011-02-24 Thread Jeremy
I recently found the wiki page on sorting (http://wiki.python.org/moin/HowTo/Sorting/). This page describes the new key parameter to the sort and sorted functions. What about custom objects? Can I just write __lt__, __gt__, etc. functions and not have to worry about the key parameter? Is t