[Python-ideas] Make max() stable

Chris Angelico rosuav at gmail.com
Tue Jan 21 21:24:33 CET 2014


On Wed, Jan 22, 2014 at 7:17 AM,  <random832 at fastmail.us> wrote:
> On Fri, Jan 17, 2014, at 11:15, Chris Angelico wrote:
>> By that definition, a stable sort means that:
>>
>> lst = sorted((x,y))
>> assert lst == [min(lst), max(lst)]
>>
>> will pass for any x and y.
>
> What definition of stable is this?
> Why not assert lst == [min(lst), max(lst[::-1])]?

The OP's definition.

ChrisA


More information about the Python-ideas mailing list