File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,17 +98,17 @@ def test():
9898
9999 t = time .time ()
100100 A = list (map (pow3 , range (N )))
101- print ('\t map(pow3, xrange (%d)):\n \t \t %s seconds' % \
101+ print ('\t map(pow3, range (%d)):\n \t \t %s seconds' % \
102102 (N , time .time () - t ))
103103
104104 t = time .time ()
105105 B = pool .map (pow3 , range (N ))
106- print ('\t pool.map(pow3, xrange (%d)):\n \t \t %s seconds' % \
106+ print ('\t pool.map(pow3, range (%d)):\n \t \t %s seconds' % \
107107 (N , time .time () - t ))
108108
109109 t = time .time ()
110110 C = list (pool .imap (pow3 , range (N ), chunksize = N // 8 ))
111- print ('\t list(pool.imap(pow3, xrange (%d), chunksize=%d)):\n \t \t %s' \
111+ print ('\t list(pool.imap(pow3, range (%d), chunksize=%d)):\n \t \t %s' \
112112 ' seconds' % (N , N // 8 , time .time () - t ))
113113
114114 assert A == B == C , (len (A ), len (B ), len (C ))
Original file line number Diff line number Diff line change @@ -396,7 +396,7 @@ by file descriptors.
396396 Close all file descriptors from *fd_low * (inclusive) to *fd_high * (exclusive),
397397 ignoring errors. Availability: Unix, Windows. Equivalent to::
398398
399- for fd in xrange (fd_low, fd_high):
399+ for fd in range (fd_low, fd_high):
400400 try:
401401 os.close(fd)
402402 except OSError:
Original file line number Diff line number Diff line change @@ -606,7 +606,7 @@ from time import clock as now
606606
607607def fill(n):
608608 from random import random
609- return [random() for i in xrange (n)]
609+ return [random() for i in range (n)]
610610
611611def mycmp(x, y):
612612 global ncmp
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ PyTypeObject PyRangeIter_Type = {
431431 rangeiter_new , /* tp_new */
432432};
433433
434- /* Return number of items in range/xrange (lo, hi, step). step > 0
434+ /* Return number of items in range (lo, hi, step). step > 0
435435 * required. Return a value < 0 if & only if the true value is too
436436 * large to fit in a signed long.
437437 */
Original file line number Diff line number Diff line change @@ -260,10 +260,7 @@ class IntegerCounting(Test):
260260
261261 # Run test rounds
262262 #
263- # NOTE: Use xrange() for all test loops unless you want to face
264- # a 20MB process !
265- #
266- for i in xrange(self.rounds):
263+ for i in range(self.rounds):
267264
268265 # Repeat the operations per round to raise the run-time
269266 # per operation significantly above the noise level of the
@@ -305,7 +302,7 @@ class IntegerCounting(Test):
305302 a = 1
306303
307304 # Run test rounds (without actually doing any operation)
308- for i in xrange (self.rounds):
305+ for i in range (self.rounds):
309306
310307 # Skip the actual execution of the operations, since we
311308 # only want to measure the test's administration overhead.
You can’t perform that action at this time.
0 commit comments