On Fri, Jun 5, 2015 at 9:50 AM, Stefan Behnel wrote:
> [Stable sorting is] a general property of Python's sort algorithm.
And at times an extremely valuable property.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Sorting in reverse does not give the same result as sorting then
> reversing.
>
> It's easiest to see with a key function:
>
>
> py> a = ['fox', 'dog', 'DOG', 'cat', 'ape']
> py> b = a[:]
> py> a.sort(key=str.lower, reverse=True)
> py> b.sort(key=str.lower)
> py> b.reve
Steven D'Aprano schrieb am 05.06.2015 um 16:07:
> Sorting in reverse does not give the same result as sorting then reversing.
>
> It's easiest to see with a key function:
>
> py> a = ['fox', 'dog', 'DOG', 'cat', 'ape']
> py> b = a[:]
> py> a.sort(key=str.lower, reverse=True)
> py> b.sort(key=str.
Sorting in reverse does not give the same result as sorting then reversing.
It's easiest to see with a key function:
py> a = ['fox', 'dog', 'DOG', 'cat', 'ape']
py> b = a[:]
py> a.sort(key=str.lower, reverse=True)
py> b.sort(key=str.lower)
py> b.reverse()
py> a
['fox', 'dog', 'DOG', 'cat', 'ape'