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
{{ message }}
Repository navigation
Commit 2c786ab
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/design/typedpython-aot.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -578,7 +578,7 @@ is applied (its body binds nothing and makes no function). As `list_sort_impl` d
578
578
then every key, left to right, into a hidden list (a key that raises stops the sort before any item moved), then
579
579
CPython's listsort orders (key, position) pairs by key only (`TPA__DEF_KEYSORT`, the same `TPA__DEF_SORT`, so the
580
580
pairs move as CPython moves its keys and values together) and each list is moved by the positions (one list, or
581
-
every element list of a list of tuples). Keys are int (raw or big), float or str; a tuple key is not in yet. While
581
+
every element list of a list of tuples). Keys are int (raw or big), float or str, or (sorted() and list.sort() only) a tuple of int and str elements: the hidden list of keys is then a list of tuples, its element lists are the sort's columns, and `tpa_tuple_keysort` compares them as CPython compares tuples, the first column whose items differ deciding (agent proposal, not owner-confirmed). A float element is refused (NaN is not equal to itself, which tuple comparison's equality step depends on), and so is a tuple key of min() / max(). While
582
582
CPython computes the keys of `xs.sort` the list is empty, so a key that reaches `xs` sees `[]`: `xs.sort(key=k)` is
583
583
refused unless its items are int, float, str, bool, bytes, `str | None` or tuples of them and every name the key
584
584
reads that the function binds holds one of those (sort a copy with sorted() otherwise). Without a key it is in (agent proposal, not confirmed): `xs.sort(reverse=r)` of a list of int,
0 commit comments