[Python-checkins] r74613 - in python/branches/py3k: Doc/includes/mp_pool.py Doc/library/os.rst Objects/listsort.txt Objects/rangeobject.c Tools/pybench/README

georg.brandl python-checkins at python.org
Tue Sep 1 09:34:27 CEST 2009


Author: georg.brandl
Date: Tue Sep 1 09:34:27 2009
New Revision: 74613
Log:
#6814: remove traces of xrange().
Modified:
 python/branches/py3k/Doc/includes/mp_pool.py
 python/branches/py3k/Doc/library/os.rst
 python/branches/py3k/Objects/listsort.txt
 python/branches/py3k/Objects/rangeobject.c
 python/branches/py3k/Tools/pybench/README
Modified: python/branches/py3k/Doc/includes/mp_pool.py
==============================================================================
--- python/branches/py3k/Doc/includes/mp_pool.py	(original)
+++ python/branches/py3k/Doc/includes/mp_pool.py	Tue Sep 1 09:34:27 2009
@@ -98,17 +98,17 @@
 
 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))
Modified: python/branches/py3k/Doc/library/os.rst
==============================================================================
--- python/branches/py3k/Doc/library/os.rst	(original)
+++ python/branches/py3k/Doc/library/os.rst	Tue Sep 1 09:34:27 2009
@@ -396,7 +396,7 @@
 Close all file descriptors from *fd_low* (inclusive) to *fd_high* (exclusive),
 ignoring errors. Availability: Unix, Windows. Equivalent to::
 
- for fd in xrange(fd_low, fd_high):
+ for fd in range(fd_low, fd_high):
 try:
 os.close(fd)
 except OSError:
Modified: python/branches/py3k/Objects/listsort.txt
==============================================================================
--- python/branches/py3k/Objects/listsort.txt	(original)
+++ python/branches/py3k/Objects/listsort.txt	Tue Sep 1 09:34:27 2009
@@ -606,7 +606,7 @@
 
 def fill(n):
 from random import random
- return [random() for i in xrange(n)]
+ return [random() for i in range(n)]
 
 def mycmp(x, y):
 global ncmp
Modified: python/branches/py3k/Objects/rangeobject.c
==============================================================================
--- python/branches/py3k/Objects/rangeobject.c	(original)
+++ python/branches/py3k/Objects/rangeobject.c	Tue Sep 1 09:34:27 2009
@@ -431,7 +431,7 @@
 	rangeiter_new,				/* tp_new */
 };
 
-/* Return number of items in range/xrange (lo, hi, step). step > 0
+/* Return number of items in range (lo, hi, step). step > 0
 * required. Return a value < 0 if & only if the true value is too
 * large to fit in a signed long.
 */
Modified: python/branches/py3k/Tools/pybench/README
==============================================================================
--- python/branches/py3k/Tools/pybench/README	(original)
+++ python/branches/py3k/Tools/pybench/README	Tue Sep 1 09:34:27 2009
@@ -260,10 +260,7 @@
 
 # Run test rounds
 	#
- # NOTE: Use xrange() for all test loops unless you want to face
-	# a 20MB process !
-	#
- for i in xrange(self.rounds):
+ for i in range(self.rounds):
 
 # Repeat the operations per round to raise the run-time
 # per operation significantly above the noise level of the
@@ -305,7 +302,7 @@
 a = 1
 
 # Run test rounds (without actually doing any operation)
- for i in xrange(self.rounds):
+ for i in range(self.rounds):
 
 	 # Skip the actual execution of the operations, since we
 	 # only want to measure the test's administration overhead.


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /