Message247328
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. |
|
Date |
User |
Action |
Args |
2015-07-25 09:51:11 | jwilk | set | recipients:
+ jwilk, docs@python |
2015-07-25 09:51:11 | jwilk | set | messageid: <1437817871.39.0.0442628081402.issue24715@psf.upfronthosting.co.za> |
2015-07-25 09:51:11 | jwilk | link | issue24715 messages |
2015-07-25 09:51:11 | jwilk | create | |
|