File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -1412,8 +1412,8 @@ are always available. They are listed here in alphabetical order.
1412
1412
Has two optional arguments which must be specified as keyword arguments.
1413
1413
1414
1414
*key * specifies a function of one argument that is used to extract a comparison
1415
- key from each list element: ``key=str.lower ``. The default value is `` None ``
1416
- (compare the elements directly).
1415
+ key from each element in * iterable * (for example, ``key=str.lower ``) . The
1416
+ default value is `` None `` (compare the elements directly).
1417
1417
1418
1418
*reverse * is a boolean value. If set to ``True ``, then the list elements are
1419
1419
sorted as if each comparison were reversed.
Original file line number Diff line number Diff line change @@ -112,17 +112,17 @@ The module also offers three general purpose functions based on heaps.
112
112
113
113
Return a list with the *n * largest elements from the dataset defined by
114
114
*iterable *. *key *, if provided, specifies a function of one argument that is
115
- used to extract a comparison key from each element in the iterable:
116
- ``key=str.lower `` Equivalent to: ``sorted(iterable, key=key,
117
- reverse=True)[:n] ``
115
+ used to extract a comparison key from each element in * iterable * (for example,
116
+ ``key=str.lower ``). Equivalent to: ``sorted(iterable, key=key,
117
+ reverse=True)[:n] ``.
118
118
119
119
120
120
.. function :: nsmallest(n, iterable, key=None)
121
121
122
122
Return a list with the *n * smallest elements from the dataset defined by
123
123
*iterable *. *key *, if provided, specifies a function of one argument that is
124
- used to extract a comparison key from each element in the iterable:
125
- ``key=str.lower `` Equivalent to: ``sorted(iterable, key=key)[:n] ``
124
+ used to extract a comparison key from each element in * iterable * (for example,
125
+ ``key=str.lower ``). Equivalent to: ``sorted(iterable, key=key)[:n] ``.
126
126
127
127
128
128
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