Sorting using lambda not working in Py2.1?

Marcin 'Qrczak' Kowalczyk qrczak at knm.org.pl
Fri May 4 06:47:13 CEST 2001


Thu, 3 May 2001 18:57:51 +0200, Alex Martelli <aleaxit at yahoo.com> pisze:

> This violates the semantic constraints on sort's optional argument:
> it must be a function that only returns 0 when arguments are to
> be considered EQUAL for sorting purposes.  This will also return
> 0 when x>y -- not just when they're equal.

Note that using different types for
    Booleans
    integers
    ordering (less, equal or greater)
no matter if statically checked or not, would help to detect the error.

-- 
 __("<  Marcin Kowalczyk * qrczak at knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK



More information about the Python-list mailing list