[Patches] [ python-Patches-728597 ] Make timeit.Timer more useful inside scripts.

SourceForge.net noreply@sourceforge.net
Sun, 27 Apr 2003 13:53:50 -0700


Patches item #728597, was opened at 2003-04-27 15:53
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=728597&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Raymond Hettinger (rhettinger)
Assigned to: Guido van Rossum (gvanrossum)
Summary: Make timeit.Timer more useful inside scripts.

Initial Comment:
The patch makes it possible to pass in an execution 
environment.  This makes it easier to instrument 
existing programs with timeit.

With the patch, the following script is possible:

import timeit

def f(x):
   return 3 * x + 1

print timeit.Timer('f(10)', env=globals()).repeat()


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=728597&group_id=5470