mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
bpo-40670: More reliable validation of statements in timeit.Timer. (GH-22358)
It now accepts "empty" statements (only whitespaces and comments) and rejects misindentent statements.
This commit is contained in:
parent
c5cb077ab3
commit
557b9a52ed
3 changed files with 13 additions and 0 deletions
|
|
@ -72,6 +72,7 @@ def inner(_it, _timer{init}):
|
|||
_t0 = _timer()
|
||||
for _i in _it:
|
||||
{stmt}
|
||||
pass
|
||||
_t1 = _timer()
|
||||
return _t1 - _t0
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue