]> granicus.if.org Git - python/commitdiff
#18518: mention that including a return statement changes/breaks the behaviour
authorAndrew Kuchling <amk@amk.ca>
Mon, 14 Apr 2014 17:39:43 +0000 (13:39 -0400)
committerAndrew Kuchling <amk@amk.ca>
Mon, 14 Apr 2014 17:39:43 +0000 (13:39 -0400)
Doc/library/timeit.rst

index 0cc15868db6a833c6903790a43d71ea66ba659a8..824a8a316051eb448ab5c9ae5cba408daa3e2aac 100644 (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)