[Patches] [ python-Patches-717575 ] allow timeit to see your globals()

SourceForge.net noreply@sourceforge.net
Fri, 25 Apr 2003 12:41:02 -0700


Patches item #717575, was opened at 2003-04-08 11:44
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=717575&group_id=5470

Category: Library (Lib)
Group: Python 2.3
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Guido van Rossum (gvanrossum)
Summary: allow timeit to see your globals()

Initial Comment:
This patch allows the timeit caller to specify the globals() for the
code snippet being timed.

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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2003-04-25 15:41

Message:
Logged In: YES 
user_id=6380

You could've copy-pasted it into the setup code. Or you
could've put

  from __main__ import my_function

in the setup code. I think passing in globals is just
another way of doing something you can already do.

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

Comment By: Skip Montanaro (montanaro)
Date: 2003-04-25 15:33

Message:
Logged In: YES 
user_id=44345

The first time I wanted to use timeit, I wanted to define a small function
of a few lines and have that timed.  Since the function was in my global
namespace, not that of timeit, I couldn't time it.  The only other way to get
it timed would be to shove it into builtins.


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

Comment By: Guido van Rossum (gvanrossum)
Date: 2003-04-25 15:19

Message:
Logged In: YES 
user_id=6380

What's the use case?

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

Comment By: Tim Peters (tim_one)
Date: 2003-04-25 15:01

Message:
Logged In: YES 
user_id=31435

Reassigned to timeit's author.

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

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