File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1383,8 +1383,8 @@ are always available. They are listed here in alphabetical order.
13831383 Has two optional arguments which must be specified as keyword arguments.
13841384
13851385 *key * specifies a function of one argument that is used to extract a comparison
1386- key from each list element: ``key=str.lower ``. The default value is `` None ``
1387- (compare the elements directly).
1386+ key from each element in * iterable * (for example, ``key=str.lower ``) . The
1387+ default value is `` None `` (compare the elements directly).
13881388
13891389 *reverse * is a boolean value. If set to ``True ``, then the list elements are
13901390 sorted as if each comparison were reversed.
Original file line number Diff line number Diff line change @@ -110,17 +110,17 @@ The module also offers three general purpose functions based on heaps.
110110
111111 Return a list with the *n * largest elements from the dataset defined by
112112 *iterable *. *key *, if provided, specifies a function of one argument that is
113- used to extract a comparison key from each element in the iterable:
114- ``key=str.lower `` Equivalent to: ``sorted(iterable, key=key,
115- reverse=True)[:n] ``
113+ used to extract a comparison key from each element in * iterable * (for example,
114+ ``key=str.lower ``). Equivalent to: ``sorted(iterable, key=key,
115+ reverse=True)[:n] ``.
116116
117117
118118.. function :: nsmallest(n, iterable, key=None)
119119
120120 Return a list with the *n * smallest elements from the dataset defined by
121121 *iterable *. *key *, if provided, specifies a function of one argument that is
122- used to extract a comparison key from each element in the iterable:
123- ``key=str.lower `` Equivalent to: ``sorted(iterable, key=key)[:n] ``
122+ used to extract a comparison key from each element in * iterable * (for example,
123+ ``key=str.lower ``). Equivalent to: ``sorted(iterable, key=key)[:n] ``.
124124
125125
126126The latter two functions perform best for smaller values of *n *. For larger
You can’t perform that action at this time.
0 commit comments