mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
This test depends on the exact ordering produced by the WichmannHill
random number generator. Altered it a bit to use the old generator and restore the test.
This commit is contained in:
parent
4647f5090a
commit
dd24a9f363
1 changed files with 3 additions and 3 deletions
|
@ -444,15 +444,15 @@ Subject: Re: PEP 255: Simple Generators
|
||||||
>>> roots = sets[:]
|
>>> roots = sets[:]
|
||||||
|
|
||||||
>>> import random
|
>>> import random
|
||||||
>>> random.seed(42)
|
>>> gen = random.WichmannHill(42)
|
||||||
>>> while 1:
|
>>> while 1:
|
||||||
... for s in sets:
|
... for s in sets:
|
||||||
... print "%s->%s" % (s, s.find()),
|
... print "%s->%s" % (s, s.find()),
|
||||||
... print
|
... print
|
||||||
... if len(roots) > 1:
|
... if len(roots) > 1:
|
||||||
... s1 = random.choice(roots)
|
... s1 = gen.choice(roots)
|
||||||
... roots.remove(s1)
|
... roots.remove(s1)
|
||||||
... s2 = random.choice(roots)
|
... s2 = gen.choice(roots)
|
||||||
... s1.union(s2)
|
... s1.union(s2)
|
||||||
... print "merged", s1, "into", s2
|
... print "merged", s1, "into", s2
|
||||||
... else:
|
... else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue