#18518: mention that including a return statement changes/breaks the behaviour

This commit is contained in:
Andrew Kuchling 2014-04-14 13:39:43 -04:00
parent 40470e00b5
commit 44da19a63d
1 changed files with 6 additions and 0 deletions

View File

@ -63,6 +63,12 @@ The module defines three convenience functions and a public class:
Create a :class:`Timer` instance with the given statement, *setup* code and
*timer* function and run its :meth:`.timeit` method with *number* executions.
.. note::
Because :meth:`.timeit` is executing *stmt*, placing a return statement
in *stmt* will prevent :meth:`.timeit` from returning execution time.
It will instead return the data specified by your return statement.
.. function:: repeat(stmt='pass', setup='pass', timer=<default timer>, repeat=3, number=1000000)