]> granicus.if.org Git - python/commitdiff
bpo-36018: Make "seed" into a keyword only argument (GH-12921)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Tue, 23 Apr 2019 08:46:18 +0000 (01:46 -0700)
committerGitHub <noreply@github.com>
Tue, 23 Apr 2019 08:46:18 +0000 (01:46 -0700)
Doc/library/statistics.rst
Lib/statistics.py

index b62bcfdffd0b39220c50b8a4f9ee13ad38ebe853..fb7df4e7188a077cd06f99da5ddf9a618e3fee2a 100644 (file)
@@ -607,7 +607,7 @@ of applications in statistics.
        :exc:`StatisticsError` because it takes at least one point to estimate
        a central value and at least two points to estimate dispersion.
 
-    .. method:: NormalDist.samples(n, seed=None)
+    .. method:: NormalDist.samples(n, *, seed=None)
 
        Generates *n* random samples for a given mean and standard deviation.
        Returns a :class:`list` of :class:`float` values.
index 4a0978cbcd9c897e1b0a12517a4b0fd4c95f6f05..19db8e82801013439a3bc99fcf851e7e97d761b0 100644 (file)
@@ -797,7 +797,7 @@ class NormalDist:
         xbar = fmean(data)
         return cls(xbar, stdev(data, xbar))
 
-    def samples(self, n, seed=None):
+    def samples(self, n, *, seed=None):
         'Generate *n* samples for a given mean and standard deviation.'
         gauss = random.gauss if seed is None else random.Random(seed).gauss
         mu, sigma = self.mu, self.sigma