Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb8c7d5

Browse files
authored
bpo-36018: Make "seed" into a keyword only argument (GH-12921)
1 parent 7280048 commit fb8c7d5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Doc/library/statistics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ of applications in statistics.
607607
:exc:`StatisticsError` because it takes at least one point to estimate
608608
a central value and at least two points to estimate dispersion.
609609

610-
.. method:: NormalDist.samples(n, seed=None)
610+
.. method:: NormalDist.samples(n, *, seed=None)
611611

612612
Generates *n* random samples for a given mean and standard deviation.
613613
Returns a :class:`list` of :class:`float` values.

Lib/statistics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def from_samples(cls, data):
797797
xbar = fmean(data)
798798
return cls(xbar, stdev(data, xbar))
799799

800-
def samples(self, n, seed=None):
800+
def samples(self, n, *, seed=None):
801801
'Generate *n* samples for a given mean and standard deviation.'
802802
gauss = random.gauss if seed is None else random.Random(seed).gauss
803803
mu, sigma = self.mu, self.sigma

0 commit comments

Comments
 (0)