[issue18518] return-ing within code timed with timeit.timeit causes wrong return value of timeit.timeit
31 Dec
2014
31 Dec
'14
11:16 a.m.
Serhiy Storchaka added the comment:
May be add a guard against statements which can confuse timeit? These are not only "return", but "yield", and "break" and "continue" outside of a loop. Proposed patch checks that testing code can be compiled outside of a function.
----------
assignee: docs@python ->
components: +Library (Lib) -Documentation
nosy: +serhiy.storchaka
stage: -> patch review
versions: +Python 3.5 -Python 3.3
Added file: http://bugs.python.org/file37577/timeit_reject_invalid_statements.patch
_______________________________________
Python tracker
3403
Age (days ago)
3403
Last active (days ago)
0 comments
1 participants
participants (1)
-
Serhiy Storchaka