[Python-Dev] Python3 regret about deleting list.sort(cmp=...)
Glenn Linderman
v+python at g.nevcal.com
Sun Mar 13 00:00:34 CET 2011
On 3/12/2011 1:55 PM, Fredrik Johansson wrote:
> Consider sorting a list of pairs representing fractions. This can be
> done easily in Python 2.x with the comparison function lambda
> (p,q),(r,s): cmp(p*s, q*r). In Python 2.6, this is about 40 times
> faster than using fractions.Fraction as a key function.
Am I correct in concluding that various ideas to eliminate or limit the
size of the key= cache would not help this use case at all?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110312/b71131eb/attachment.html>
More information about the Python-Dev
mailing list