This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jwilk
Recipients docs@python, jwilk
Date 2015-07-25.09:51:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437817871.39.0.0442628081402.issue24715@psf.upfronthosting.co.za>
In-reply-to
Content
https://docs.python.org/3/howto/sorting.html#odd-and-ends gives the following example for reverse sort stability:

>>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]
>>> assert sorted(data, reverse=True) == list(reversed(sorted(reversed(data))))

But here all the keys are different, so the result would be the same even if the sort algorithm weren't stable.

You probably wanted to pass to key=itemgetter(0) to both sorted() calls.
History
Date User Action Args
2015-07-25 09:51:11jwilksetrecipients: + jwilk, docs@python
2015-07-25 09:51:11jwilksetmessageid: <1437817871.39.0.0442628081402.issue24715@psf.upfronthosting.co.za>
2015-07-25 09:51:11jwilklinkissue24715 messages
2015-07-25 09:51:11jwilkcreate