From 1fe4bd56bc825bce73b1bfccb1c81531acc5cf89 Mon Sep 17 00:00:00 2001 From: Evan Kohilas Date: Sat, 29 Mar 2025 16:09:39 +1100 Subject: [PATCH 1/6] Updates functions.rst to make iterable positional only --- Doc/library/functions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 7e367a0f2b6b25..02ada33a8f3e12 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1220,8 +1220,8 @@ are always available. They are listed here in alphabetical order. Added the *strict* parameter. -.. function:: max(iterable, *, key=None) - max(iterable, *, default, key=None) +.. function:: max(iterable, /, *, key=None) + max(iterable, /, *, default, key=None) max(arg1, arg2, *args, key=None) Return the largest item in an iterable or the largest of two or more From bd686b0f2ff23ae94f39b65d7b39533410ed7c7a Mon Sep 17 00:00:00 2001 From: Evan Kohilas Date: Sat, 29 Mar 2025 16:22:42 +1100 Subject: [PATCH 2/6] functions.rst for min --- Doc/library/functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 02ada33a8f3e12..0d926485e67e3c 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1258,7 +1258,7 @@ are always available. They are listed here in alphabetical order. :ref:`typememoryview` for more information. -.. function:: min(iterable, *, key=None) +.. function:: min(iterable, /, *, key=None) min(iterable, *, default, key=None) min(arg1, arg2, *args, key=None) From c48ff1b7f4c7622b3afaaab33f1378b82f7326f5 Mon Sep 17 00:00:00 2001 From: Evan Kohilas Date: Sat, 29 Mar 2025 16:23:09 +1100 Subject: [PATCH 3/6] Update functions.rst --- Doc/library/functions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 0d926485e67e3c..e47ccbfe10bfb6 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1259,7 +1259,7 @@ are always available. They are listed here in alphabetical order. .. function:: min(iterable, /, *, key=None) - min(iterable, *, default, key=None) + min(iterable, /, *, default, key=None) min(arg1, arg2, *args, key=None) Return the smallest item in an iterable or the smallest of two or more From df21826c08eef70703e79fc5aabb38514fd17d64 Mon Sep 17 00:00:00 2001 From: Evan Kohilas Date: Sat, 29 Mar 2025 16:24:37 +1100 Subject: [PATCH 4/6] Update bltinmodule.c for min and max --- Python/bltinmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 10e415fa052f64..12d37e172807b1 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2019,7 +2019,7 @@ builtin_min(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *k } PyDoc_STRVAR(min_doc, -"min(iterable, *[, default=obj, key=func]) -> value\n\ +"min(iterable, /, *[, default=obj, key=func]) -> value\n\ min(arg1, arg2, *args, *[, key=func]) -> value\n\ \n\ With a single iterable argument, return its smallest item. The\n\ @@ -2036,7 +2036,7 @@ builtin_max(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *k } PyDoc_STRVAR(max_doc, -"max(iterable, *[, default=obj, key=func]) -> value\n\ +"max(iterable, /, *[, default=obj, key=func]) -> value\n\ max(arg1, arg2, *args, *[, key=func]) -> value\n\ \n\ With a single iterable argument, return its biggest item. The\n\ From e3399a2c1dacd291c7f398b6a236298ce8125763 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Sun, 30 Mar 2025 04:30:14 +0300 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Evan Kohilas --- Doc/library/functions.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index e47ccbfe10bfb6..530ef5b5644477 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1222,7 +1222,7 @@ are always available. They are listed here in alphabetical order. .. function:: max(iterable, /, *, key=None) max(iterable, /, *, default, key=None) - max(arg1, arg2, *args, key=None) + max(arg1, arg2, /, *args, key=None) Return the largest item in an iterable or the largest of two or more arguments. @@ -1260,7 +1260,7 @@ are always available. They are listed here in alphabetical order. .. function:: min(iterable, /, *, key=None) min(iterable, /, *, default, key=None) - min(arg1, arg2, *args, key=None) + min(arg1, arg2, /, *args, key=None) Return the smallest item in an iterable or the smallest of two or more arguments. From 2e26c237c905fd1181178cc9d4495b1a5e2a0a08 Mon Sep 17 00:00:00 2001 From: Evan Kohilas Date: Fri, 11 Apr 2025 18:54:32 +1000 Subject: [PATCH 6/6] revert --- Python/bltinmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 12d37e172807b1..10e415fa052f64 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2019,7 +2019,7 @@ builtin_min(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *k } PyDoc_STRVAR(min_doc, -"min(iterable, /, *[, default=obj, key=func]) -> value\n\ +"min(iterable, *[, default=obj, key=func]) -> value\n\ min(arg1, arg2, *args, *[, key=func]) -> value\n\ \n\ With a single iterable argument, return its smallest item. The\n\ @@ -2036,7 +2036,7 @@ builtin_max(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *k } PyDoc_STRVAR(max_doc, -"max(iterable, /, *[, default=obj, key=func]) -> value\n\ +"max(iterable, *[, default=obj, key=func]) -> value\n\ max(arg1, arg2, *args, *[, key=func]) -> value\n\ \n\ With a single iterable argument, return its biggest item. The\n\