]> granicus.if.org Git - python/commitdiff
bpo-36546: Mark first argument as position only (GH-14363)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Tue, 25 Jun 2019 02:39:22 +0000 (04:39 +0200)
committerGitHub <noreply@github.com>
Tue, 25 Jun 2019 02:39:22 +0000 (04:39 +0200)
Lib/statistics.py
Misc/NEWS.d/next/Library/2019-06-25-05-07-48.bpo-36546.RUcxaK.rst [new file with mode: 0644]

index 5be70e5ebf4ebb5dfe1f17598a94c76c720c9bf1..79b65a29183ca843e69aa13a36b4e06e52a6e7ed 100644 (file)
@@ -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.
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 (file)
index 0000000..f6829fb
--- /dev/null
@@ -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.