sorted or .sort() ?

Hrvoje Niksic hniksic at
Mon Jun 16 15:57:48 CEST 2008

Peter Bengtsson <peterbe at> writes:

> Does that mean that .sort() is more efficient and should be favored
> when you can (i.e. when you don't mind changing the listish object)?

Yes.  Note that it's not "the listish object", the "sort" method is
implemented on actual lists, not on any sequence.

More information about the Python-list mailing list