summaryrefslogtreecommitdiffstats
path: root/Lib/timeit.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-04-03 02:45:36 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-04-03 02:45:36 (GMT)
commitb646aa178983cb1b290d1f86be149704c8957f02 (patch)
tree6fa76394f6312372541586fa37cd4464e9220d97 /Lib/timeit.py
parent85737b875f55058985a794e89ab0698f27743b11 (diff)
downloadcpython-b646aa178983cb1b290d1f86be149704c8957f02.zip
cpython-b646aa178983cb1b290d1f86be149704c8957f02.tar.gz
cpython-b646aa178983cb1b290d1f86be149704c8957f02.tar.bz2
Localize the function lookup in timeit.
Diffstat (limited to 'Lib/timeit.py')
-rw-r--r--Lib/timeit.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/timeit.py b/Lib/timeit.py
index 5ce9b4a..7b9b72c 100644
--- a/Lib/timeit.py
+++ b/Lib/timeit.py
@@ -92,11 +92,11 @@ def reindent(src, indent):
def _template_func(setup, func):
"""Create a timer function. Used if the "statement" is a callable."""
- def inner(_it, _timer):
+ def inner(_it, _timer, _func=func):
setup()
_t0 = _timer()
for _i in _it:
- func()
+ _func()
_t1 = _timer()
return _t1 - _t0
return inner