@@ -1394,7 +1394,7 @@ application).
13941394 :ref: `mutable <typesseq-mutable >` sequence operations. Lists also provide the
13951395 following additional method:
13961396
1397- .. method :: list.sort(*, key=None, reverse=False)
1397+ .. method :: list.sort(*, key=None, keylist=None, reverse=False)
13981398
13991399 This method sorts the list in place, using only ``< `` comparisons
14001400 between items. Exceptions are not suppressed - if any comparison operations
@@ -1414,6 +1414,9 @@ application).
14141414 The :func: `functools.cmp_to_key ` utility is available to convert a 2.x
14151415 style *cmp * function to a *key * function.
14161416
1417+ Alternative to key function is supplying a list to *keylist * argument,
1418+ which will determine sort order and will be modified in place.
1419+
14171420 *reverse * is a boolean value. If set to ``True ``, then the list elements
14181421 are sorted as if each comparison were reversed.
14191422
@@ -1436,6 +1439,11 @@ application).
14361439 list appear empty for the duration, and raises :exc: `ValueError ` if it can
14371440 detect that the list has been mutated during a sort.
14381441
1442+ The same applies to *keylist * argument.
1443+
1444+ .. versionchanged :: 3.15
1445+
1446+ Added *keylist * argument.
14391447
14401448.. _typesseq-tuple :
14411449
0 commit comments