[docs] [issue18518] return-ing within code timed with timeit.timeit causes wrong return value of timeit.timeit

Serhiy Storchaka report at bugs.python.org
Wed Dec 31 19:16:58 CET 2014


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 at 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 at bugs.python.org>
<http://bugs.python.org/issue18518>
_______________________________________


More information about the docs mailing list