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 @@ -1412,8 +1412,8 @@ are always available. They are listed here in alphabetical order.
14121412 Has two optional arguments which must be specified as keyword arguments.
14131413
14141414 *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).
14171417
14181418 *reverse * is a boolean value. If set to ``True ``, then the list elements are
14191419 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.
112112
113113 Return a list with the *n * largest elements from the dataset defined by
114114 *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] ``.
118118
119119
120120.. function :: nsmallest(n, iterable, key=None)
121121
122122 Return a list with the *n * smallest elements from the dataset defined by
123123 *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] ``.
126126
127127
128128The latter two functions perform best for smaller values of *n *. For larger
You can’t perform that action at this time.
0 commit comments