[Python-checkins] cpython (2.7): Fix rst markup in timeit docs.

ezio.melotti python-checkins at python.org
Thu Sep 20 05:15:11 CEST 2012


http://hg.python.org/cpython/rev/e0c2bd9e0ac1
changeset:   79053:e0c2bd9e0ac1
branch:      2.7
parent:      79050:3498ffd3cdee
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Thu Sep 20 06:02:50 2012 +0300
summary:
  Fix rst markup in timeit docs.

files:
  Doc/library/timeit.rst |  30 +++++++++++++++---------------
  1 files changed, 15 insertions(+), 15 deletions(-)


diff --git a/Doc/library/timeit.rst b/Doc/library/timeit.rst
--- a/Doc/library/timeit.rst
+++ b/Doc/library/timeit.rst
@@ -23,7 +23,7 @@
 The module defines the following public class:
 
 
-.. class:: Timer([stmt='pass' [, setup='pass' [, timer=<timer function>]]])
+.. class:: Timer(stmt='pass', setup='pass', timer=<timer function>)
 
    Class for timing execution speed of small code snippets.
 
@@ -33,18 +33,18 @@
    may also contain multiple statements separated by ``;`` or newlines, as long as
    they don't contain multi-line string literals.
 
-   To measure the execution time of the first statement, use the :meth:`timeit`
-   method.  The :meth:`repeat` method is a convenience to call :meth:`timeit`
+   To measure the execution time of the first statement, use the :meth:`Timer.timeit`
+   method.  The :meth:`repeat` method is a convenience to call :meth:`.timeit`
    multiple times and return a list of results.
 
    .. versionchanged:: 2.6
       The *stmt* and *setup* parameters can now also take objects that are callable
       without arguments. This will embed calls to them in a timer function that will
-      then be executed by :meth:`timeit`.  Note that the timing overhead is a little
-      larger in this case because of the extra function calls.
+      then be executed by :meth:`.timeit`.  Note that the timing overhead is a
+      little larger in this case because of the extra function calls.
 
 
-.. method:: Timer.print_exc([file=None])
+.. method:: Timer.print_exc(file=None)
 
    Helper to print a traceback from the timed code.
 
@@ -61,14 +61,14 @@
    traceback is sent; it defaults to ``sys.stderr``.
 
 
-.. method:: Timer.repeat([repeat=3 [, number=1000000]])
+.. method:: Timer.repeat(repeat=3, number=1000000)
 
-   Call :meth:`timeit` a few times.
+   Call :meth:`.timeit` a few times.
 
-   This is a convenience function that calls the :meth:`timeit` repeatedly,
+   This is a convenience function that calls the :meth:`.timeit` repeatedly,
    returning a list of results.  The first argument specifies how many times to
-   call :meth:`timeit`.  The second argument specifies the *number* argument for
-   :func:`timeit`.
+   call :meth:`.timeit`.  The second argument specifies the *number* argument for
+   :meth:`.timeit`.
 
    .. note::
 
@@ -82,7 +82,7 @@
       and apply common sense rather than statistics.
 
 
-.. method:: Timer.timeit([number=1000000])
+.. method:: Timer.timeit(number=1000000)
 
    Time *number* executions of the main statement. This executes the setup
    statement once, and then returns the time it takes to execute the main statement
@@ -92,7 +92,7 @@
 
    .. note::
 
-      By default, :meth:`timeit` temporarily turns off :term:`garbage collection`
+      By default, :meth:`.timeit` temporarily turns off :term:`garbage collection`
       during the timing.  The advantage of this approach is that it makes
       independent timings more comparable.  This disadvantage is that GC may be
       an important component of the performance of the function being measured.
@@ -126,7 +126,7 @@
 .. function:: timeit(stmt, setup='pass', timer=default_timer, number=1000000)
 
    Create a :class:`Timer` instance with the given statement, setup code and timer
-   function and run its :meth:`timeit` method with *number* executions.
+   function and run its :meth:`.timeit` method with *number* executions.
 
    .. versionadded:: 2.6
 
@@ -248,7 +248,7 @@
    3.15 usec/pass
 
 To give the :mod:`timeit` module access to functions you define, you can pass a
-``setup`` parameter which contains an import statement::
+*setup* parameter which contains an import statement::
 
    def test():
        """Stupid test function"""

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list