"Martin v. Loewis" <mar...@v.loewis.de> writes: > And indeed, that's available, by means of the key= argument to list.sort.
Unfortunately what's needed for more generality is the ability to supply a comparison function, which Python2 also offers, but Python3 removes. I gave an example a while back of wanting to compare two tree structures, and Raymond H. explained how to do it with just a key function, which seemed ok at the time. But thinking about it further afterwards, I believe both of us missed then that the method suggested doesn't always work, so you really do need cmp. I'll see if I can find the old post and reconstruct the problem. -- http://mail.python.org/mailman/listinfo/python-list