You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to v2.3 Python seemed to use an adapted version of quicksort (unstable, most probably samplesort), from v2.3 to v3.10 it used timsort, while from v3.10 on it uses powersort
Python sorting algorithm is guaranteed to be stable, while the polyfill is NOT stable.
🧪 Tests
The purpose of this test is to sort a list of dictionaries first by the
result
key (ascending order), then by theduration
key (descending order).✅ Python (3.9)
This works as expected, since the returned output is ordered by
result
(first the entries with0
) then byduration
(biggest to smallest).Code:
Output:
❌ Jython 2.1
This test fails, since the returned output is sorted only by
result
, while theduration
key is not even in the same order as the input list.Code:
Output:
The text was updated successfully, but these errors were encountered: