On 12/8/2010 1:47 AM, Steven D'Aprano wrote:
On Wed, 08 Dec 2010 11:58:03 +1100, Ben Finney wrote:

Carl Banks<pavlovevide...@gmail.com>  writes:

On Dec 6, 4:17 pm, Steven D'Aprano<steve
+comp.lang.pyt...@pearwood.info>  wrote:
Nevertheless, I agree that in hindsight, the ability to sort such
lists is not as important as the consistency of comparisons.

I think that feeling the need to sort non-homogenous lists is
indicative of bad design.

It can also be indicative of code written for a Python that doesn't have
sets.

Or a list that contains unhashable objects.

   If you can't hash it, and it doesn't have some definition of
comparison associated with the object, you probably can't order
it properly, either.

   "<" can't be some random function.  For sorting to work,

        a < b and b < c implies a < c

must hold.

                                John Nagle
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to