Sorting using lambda not working in Py2.1?
Erik Max Francis
max at alcyone.com
Thu May 3 12:28:33 EDT 2001
mary wrote:
> I may be doing something wrong, or is this a bug in 2.1?
>
> x = (9,5,4,3,1,2)
>
> print x.sort()
> -> (1,2,3,4,5,9)
> print x.sort(lamda x,y: x<y)
> -> (9,5,4,3,1,2) !!
It would seem so, but something curious is going on here -- this clearly
isn't pasted in directly from a Python interpreter, since tuples can't
be sorted in place ...
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ An ounce of hypocrisy is worth a pound of ambition.
\__/ Michael Korda
The laws list / http://www.alcyone.com/max/physics/laws/
Laws, rules, principles, effects, paradoxes, etc. in physics.
More information about the Python-list
mailing list