[issue15979] Improve timeit documentation

Chris Jerdonek report at bugs.python.org
Tue Oct 2 03:36:37 CEST 2012


Chris Jerdonek added the comment:

I copy-edited the patch just looking for minor things like punctuation, etc:

+a :ref:`command-line-interface` as well as :ref:`callable <python-interface>`

a callable one

+See also Tim Peters' introduction to the "Algorithms" chapter in the Python
+Cookbook, published by O'Reilly.

italicize or underline book titles (is there a reST directive for books?)

+The following example shows how the :ref:`command-line-interface`,

no comma

+Python interface

Python Interface

+   Create a :class:`Timer` instance with the given statement, setup code and timer
+   function and run its :meth:`.timeit` method with *number* executions.

stars around setup and timer like there is with *number*?

+   Create a :class:`Timer` instance with the given statement, setup code and timer
+   function and run its :meth:`.repeat` method with the given *repeat* count and

ditto

+   Define a default timer, in a platform specific manner. On Windows,

platform-specific

+   :func:`time.clock` has microsecond granularity but :func:`time.time`'s

granularity, but

+   granularity is 1/60th of a second; on Unix, :func:`time.clock` has 1/100th of

I would just split this into two sentences since it already combines two compound sentences (i.e. it is effectively four sentences):

second.  On Unix,

+   a second granularity and :func:`time.time` is much more precise.  On either

granularity, and

+   Time *number* executions of the main statement. This executes the setup

statement.  This

+   statement once, and then returns the time it takes to execute the main statement
+   a number of times, measured in seconds as a float.  The argument is the number

*number* times

+   baseline overhead can be measured by invoking the program without arguments and

arguments, and

----------
nosy: +chris.jerdonek

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15979>
_______________________________________


More information about the Python-bugs-list mailing list