File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1383,8 +1383,8 @@ are always available. They are listed here in alphabetical order.
1383
1383
Has two optional arguments which must be specified as keyword arguments.
1384
1384
1385
1385
*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).
1388
1388
1389
1389
*reverse * is a boolean value. If set to ``True ``, then the list elements are
1390
1390
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.
110
110
111
111
Return a list with the *n * largest elements from the dataset defined by
112
112
*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] ``.
116
116
117
117
118
118
.. function :: nsmallest(n, iterable, key=None)
119
119
120
120
Return a list with the *n * smallest elements from the dataset defined by
121
121
*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] ``.
124
124
125
125
126
126
The latter two functions perform best for smaller values of *n *. For larger
You can’t perform that action at this time.
0 commit comments