mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
#6814: remove traces of xrange().
This commit is contained in:
parent
a4c05a26a7
commit
c9a5a0e165
5 changed files with 8 additions and 11 deletions
|
@ -98,17 +98,17 @@ def test():
|
|||
|
||||
t = time.time()
|
||||
A = list(map(pow3, range(N)))
|
||||
print('\tmap(pow3, xrange(%d)):\n\t\t%s seconds' % \
|
||||
print('\tmap(pow3, range(%d)):\n\t\t%s seconds' % \
|
||||
(N, time.time() - t))
|
||||
|
||||
t = time.time()
|
||||
B = pool.map(pow3, range(N))
|
||||
print('\tpool.map(pow3, xrange(%d)):\n\t\t%s seconds' % \
|
||||
print('\tpool.map(pow3, range(%d)):\n\t\t%s seconds' % \
|
||||
(N, time.time() - t))
|
||||
|
||||
t = time.time()
|
||||
C = list(pool.imap(pow3, range(N), chunksize=N//8))
|
||||
print('\tlist(pool.imap(pow3, xrange(%d), chunksize=%d)):\n\t\t%s' \
|
||||
print('\tlist(pool.imap(pow3, range(%d), chunksize=%d)):\n\t\t%s' \
|
||||
' seconds' % (N, N//8, time.time() - t))
|
||||
|
||||
assert A == B == C, (len(A), len(B), len(C))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue