[Python-ideas] add a time decorator to timeit.py

Jonathan Fine jfine2358 at gmail.com
Sun Oct 7 14:40:17 EDT 2018

Summary: It's an undocumented feature, not an implementation detail.

I wrote:

> And if you're a software historian, now perhaps look at
> https://github.com/python/cpython/commits/3.7/Lib/timeit.py

Well, I've bitten my own bait, and have found it. See

    Merged revisions 53952-54987 via svnmerge from

This is a compendium commit, which contains

  r54348 | georg.brandl | 2007-03-13 12:32:21 -0700 (Tue, 13 Mar 2007) | 4 lines

  Patch #1533909: the timeit module now accepts callables in addition to
  strings for the code to time and the setup code. Also added two
  convenience functions for instantiating a Timer and calling its methods.

For the diff see

So to me that's conclusive. An undocumented feature.


More information about the Python-ideas mailing list