Sorting part of a list

Fuzzyman fuzzyman at
Fri Jun 24 14:07:54 CEST 2005

You can assign to a slice in place, but referencing a slice creates a

I think you understand it quite well :-)

a = ll[2:]
ll[2:] = a

To do a partial sort, in place, you'll have to subclass list - but
you'll still end up doing something similar unless you delve into C or
write your own sort algorithm in Python. Neither are recommended.

Best Regards,

(back online hurrah)

More information about the Python-list mailing list