Kaydet (Commit) dd42edcc authored tarafından Guido van Rossum's avatar Guido van Rossum

Rename variables _seq to _it and seq to it, to emphasize that this is

an iterator (which can only be used once!).
üst 6fa2dc70
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment