cpython: 2704e11da558 (original) (raw)

Mercurial > cpython

changeset 82132:2704e11da558

Issue #17149: merge fix from 3.3. [#17149]

Mark Dickinson dickinsm@gmail.com
date Sun, 10 Feb 2013 14:17:20 +0000
parents 029011429f80(current diff)e9b4f2927412(diff)
children 3c41e7943769
files Lib/random.py Lib/test/test_random.py Misc/NEWS
diffstat 3 files changed, 19 insertions(+), 2 deletions(-)[+] [-] Lib/random.py 4 Lib/test/test_random.py 14 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/random.py +++ b/Lib/random.py @@ -450,9 +450,9 @@ class Random(_random.Random): u3 = random() if u3 > 0.5:

return theta

--- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -512,6 +512,20 @@ class TestDistributions(unittest.TestCas self.assertAlmostEqual(s1/N, mu, places=2) self.assertAlmostEqual(s2/(N-1), sigmasqrd, places=2)

+ class TestModule(unittest.TestCase): def testMagicConstants(self): self.assertAlmostEqual(random.NV_MAGICCONST, 1.71552776992141)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -244,6 +244,9 @@ Core and Builtins Library ------- +- Issue #17149: Fix random.vonmisesvariate to always return results in