summaryrefslogtreecommitdiffstats
path: root/Lib/timeit.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2003-03-21 14:54:19 (GMT)
committerGuido van Rossum <guido@python.org>2003-03-21 14:54:19 (GMT)
commitdd42edcc9df2603036a7d0209e51af135a003319 (patch)
tree40bd7c5998eda349601bc65b3107095923519ee1 /Lib/timeit.py
parent6fa2dc70b8af4734d709d010c8d2e01b77671403 (diff)
downloadcpython-dd42edcc9df2603036a7d0209e51af135a003319.zip
cpython-dd42edcc9df2603036a7d0209e51af135a003319.tar.gz
cpython-dd42edcc9df2603036a7d0209e51af135a003319.tar.bz2
Rename variables _seq to _it and seq to it, to emphasize that this is
an iterator (which can only be used once!).
Diffstat (limited to 'Lib/timeit.py')
-rw-r--r--Lib/timeit.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/timeit.py b/Lib/timeit.py
index d7bd611..b203c2c 100644
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -75,10 +75,10 @@ else:
# in Timer.__init__() depend on setup being indented 4 spaces and stmt
# being indented 8 spaces.
template = """
-def inner(_seq, _timer):
+def inner(_it, _timer):
%(setup)s
_t0 = _timer()
- for _i in _seq:
+ for _i in _it:
%(stmt)s
_t1 = _timer()
return _t1 - _t0
@@ -151,10 +151,10 @@ class Timer:
the timer function to be used are passed to the constructor.
"""
if itertools:
- seq = itertools.repeat(None, number)
+ it = itertools.repeat(None, number)
else:
- seq = [None] * number
- return self.inner(seq, self.timer)
+ it = [None] * number
+ return self.inner(it, self.timer)
def repeat(self, repeat=default_repeat, number=default_number):
"""Call timer() a few times.