sort help

Chris Angelico rosuav at gmail.com
Tue Sep 22 19:06:39 EDT 2015


On Wed, Sep 23, 2015 at 9:02 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> On Tue, Sep 22, 2015 at 4:55 PM, Chris Angelico <rosuav at gmail.com> wrote:
>> The Python list.sort() method is guaranteed to be
>> stable. I can't find a comparable guarantee for sorted()
>
> https://docs.python.org/3.5/library/functions.html#sorted

Right, sorry. Since all I looked at was its docstring, I should have
said so :) So, yep, sorted() is guaranteed stable too, and that would
be the easiest way to subsort something.

ChrisA



More information about the Python-list mailing list