summaryrefslogtreecommitdiffstats
path: root/Doc/library/timeit.rst
diff options
context:
space:
mode:
authorAndrew Kuchling <amk@amk.ca>2014-04-14 17:39:43 (GMT)
committerAndrew Kuchling <amk@amk.ca>2014-04-14 17:39:43 (GMT)
commit44da19a63d332a11df16475744355e091c89f3b8 (patch)
treef36ad74819160e304e4a005332af1e0e880f5c8c /Doc/library/timeit.rst
parent40470e00b539095ee576513f7a98cfda020583c3 (diff)
downloadcpython-44da19a63d332a11df16475744355e091c89f3b8.zip
cpython-44da19a63d332a11df16475744355e091c89f3b8.tar.gz
cpython-44da19a63d332a11df16475744355e091c89f3b8.tar.bz2
#18518: mention that including a return statement changes/breaks the behaviour
Diffstat (limited to 'Doc/library/timeit.rst')
-rw-r--r--Doc/library/timeit.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
index 0cc1586..824a8a3 100644
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -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)