[Python-Dev] Python3 regret about deleting list.sort(cmp=...)
Eugene Toder
eltoder at gmail.com
Sat Mar 12 23:29:29 CET 2011
Can sort have an option (and/or try to figure it itself) to calculate
key for every comparison instead of caching them? This will have the
same memory requirements as with cmp, but doesn't require rewriting
code if you decide to trade speed for memory. Will this be much slower
than with cmp?
If going that route sort can also cache a limited amount of keys
(instead of all or nothing), using, for example, a LRU cache with
fixed size.
Eugene
More information about the Python-Dev
mailing list