mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-34149: Behavior of the min/max with key=None (GH-8328)
Improve consistency with the signature for sorted(), heapq.nsmallest(), heapq.nlargest(), and itertools.groupby().
This commit is contained in:
parent
bde782bb59
commit
e22072fb11
5 changed files with 17 additions and 8 deletions
|
@ -1639,6 +1639,10 @@ min_max(PyObject *args, PyObject *kwds, int op)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (keyfunc == Py_None) {
|
||||
keyfunc = NULL;
|
||||
}
|
||||
|
||||
maxitem = NULL; /* the result */
|
||||
maxval = NULL; /* the value associated with the result */
|
||||
while (( item = PyIter_Next(it) )) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue