[issue18518] return-ing within code timed with timeit.timeit causes wrong return value of timeit.timeit
![](https://secure.gravatar.com/avatar/fa0f7819f1825f596b384c19aa7dcf33.jpg?s=120&d=mm&r=g)
Dec. 31, 2014
6:16 p.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 <report@bugs.python.org> <http://bugs.python.org/issue18518> _______________________________________
3689
Age (days ago)
3689
Last active (days ago)
0 comments
1 participants
participants (1)
-
Serhiy Storchaka