[Python-checkins] python/dist/src/Lib random.py,1.39,1.40
rhettinger@users.sourceforge.net
rhettinger@users.sourceforge.net
Sat, 07 Dec 2002 01:25:08 -0800
Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv13570
Modified Files:
random.py
Log Message:
Clarify and speedup test.
Index: random.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** random.py 18 Nov 2002 09:01:21 -0000 1.39
--- random.py 7 Dec 2002 09:25:05 -0000 1.40
***************
*** 775,780 ****
for k in xrange(n+1):
s = sample(population, k)
! assert len(dict([(elem,True) for elem in s])) == len(s) == k
! assert None not in s
def _sample_generator(n, k):
--- 775,781 ----
for k in xrange(n+1):
s = sample(population, k)
! uniq = dict.fromkeys(s)
! assert len(uniq) == len(s) == k
! assert None not in uniq
def _sample_generator(n, k):