I'd like to sort a list with a custom cmp
. The original list can be destroyed. But sorted()
will return a list. I assume that it involves copying. Each element in the original list is not a small object, I want avoid copying and reuse as much the original list as possible.
Is there something like this available in python?