From 7a408cc1c94fe5f03eac8ccd28873699f0fe5dd0 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 25 Jun 2019 05:01:39 +0300 Subject: [PATCH 1/2] bpo-36546: Mark first argument as position only so we can change it later if needed --- Lib/statistics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/statistics.py b/Lib/statistics.py index 5be70e5ebf4ebb5..79b65a29183ca84 100644 --- a/Lib/statistics.py +++ b/Lib/statistics.py @@ -603,7 +603,7 @@ def multimode(data): # options make for easier choices and that external packages can be # used for anything more advanced. -def quantiles(dist, *, n=4, method='exclusive'): +def quantiles(dist, /, *, n=4, method='exclusive'): '''Divide *dist* into *n* continuous intervals with equal probability. Returns a list of (n - 1) cut points separating the intervals. From c843a76a786a7fbc6cf2182c3ff3357a16f39c37 Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Tue, 25 Jun 2019 05:08:09 +0300 Subject: [PATCH 2/2] Add blurb --- .../next/Library/2019-06-25-05-07-48.bpo-36546.RUcxaK.rst | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2019-06-25-05-07-48.bpo-36546.RUcxaK.rst diff --git a/Misc/NEWS.d/next/Library/2019-06-25-05-07-48.bpo-36546.RUcxaK.rst b/Misc/NEWS.d/next/Library/2019-06-25-05-07-48.bpo-36546.RUcxaK.rst new file mode 100644 index 000000000000000..f6829fb1727e7ee --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-06-25-05-07-48.bpo-36546.RUcxaK.rst @@ -0,0 +1,4 @@ +The *dist* argument for statistics.quantiles() is now positional only. The +current name doesn't reflect that the argument can be either a dataset or a +distribution. Marking the parameter as positional avoids confusion and +makes it possible to change the name later.