commit | d7b009e9913f835a1a91281ffe4114736008bc95 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Fri Apr 03 02:47:57 2009 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Fri Apr 03 02:47:57 2009 +0000 |
tree | 7194a61710dbf3a87590f6a31aa778e0446c88d4 | |
parent | 2ba2add41e740558fbdcf160f7f6fb0d1f4476d4 [diff] [blame] |
Localize the function lookup in timeit.
diff --git a/Lib/timeit.py b/Lib/timeit.py index c0b0856..9054243 100644 --- a/Lib/timeit.py +++ b/Lib/timeit.py
@@ -92,11 +92,11 @@ 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