It would be useful if list.sort() accepted two more optional
parameters, start and stop, so that you can sort a slice in place. In
other words,
x = range(1000000)
x.sort(start=3, stop=-1)
would be equivalent to
x[3:-1] = sorted(x[3:-1])
but more efficient and without repeating the slice twice. If it's not
too late for feature additions, I'd love to see this in 2.5.
George
parameters, start and stop, so that you can sort a slice in place. In
other words,
x = range(1000000)
x.sort(start=3, stop=-1)
would be equivalent to
x[3:-1] = sorted(x[3:-1])
but more efficient and without repeating the slice twice. If it's not
too late for feature additions, I'd love to see this in 2.5.
George
Comment