[issue18975] timeit: Use thousands separators and print number of loops per second

Jakub Stasiak report at bugs.python.org
Sun Sep 8 18:00:31 CEST 2013


New submission from Jakub Stasiak:

This patch includes:
* making code more PEP8-compatible and refactoring it a bit
* printing number of loops per second when using command line interface
* using thousands separators when printing numbers of loops (also in command line interface)
* changing examples in the module documentation

The output is changed from this:

    10000 loops, best of 3: 40.3 usec per loop

to that:

    10,000 loops, best of 3: 34.6 usec per loop, 28,870.783/s

I'm still not sure about details of "28,870.783/s" part:
* whether it should always include the fractional part (in this example it doesn't make any sense)
* maybe it should say "loops/s" rather than just "/s"

----------
components: Library (Lib)
files: timeit.patch
keywords: patch
messages: 197274
nosy: jstasiak
priority: normal
severity: normal
status: open
title: timeit: Use thousands separators and print number of loops per second
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file31672/timeit.patch

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


More information about the Python-bugs-list mailing list