[Python-checkins] python/dist/src/Lib random.py,1.45,1.46

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Fri, 17 Jan 2003 09:23:25 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv5751

Modified Files:
	random.py 
Log Message:
* Migrate sample distribution test from random.py to test_random.py.
* Use Sets module to more clearly articulate a couple of tests.


Index: random.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** random.py	7 Jan 2003 10:25:55 -0000	1.45
--- random.py	17 Jan 2003 17:23:22 -0000	1.46
***************
*** 744,750 ****
                (avg, stddev, smallest, largest)
  
- def _sample_generator(n, k):
-     # Return a fixed element from the sample.  Validates random ordering.
-     return sample(xrange(n), k)[k//2]
  
  def _test(N=2000):
--- 744,747 ----
***************
*** 765,770 ****
      _test_generator(N, 'gauss(0.0, 1.0)')
      _test_generator(N, 'betavariate(3.0, 3.0)')
-     _test_generator(N, '_sample_generator(50, 5)')  # expected s.d.: 14.4
-     _test_generator(N, '_sample_generator(50, 45)') # expected s.d.: 14.4
  
  # Create one instance, seeded from current time, and export its methods
--- 762,765 ----