Why Python3

Paul Rubin no.email at nospam.invalid
Tue Jun 29 14:30:26 EDT 2010


"Martin v. Loewis" <martin at 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.



More information about the Python-list mailing list