Re: Namespaces and the timeit module

2004-12-14 Thread Roy Smith
[EMAIL PROTECTED] (David M. Cooke) wrote: > > It seems kind of surprising that I can't time functions. Am I just not > > seeing something obvious? > > Like the documentation for Timer? :-) > > class Timer([stmt='pass' [, setup='pass' [, timer=]]]) > > You can't use statements defined elsewhe

Re: Namespaces and the timeit module

2004-12-14 Thread David M. Cooke
Roy Smith <[EMAIL PROTECTED]> writes: > I'm playing with the timeit module, and can't figure out how to time a > function call. I tried: > > def foo (): > x = 4 > return x > > t = timeit.Timer ("foo()") > print t.timeit() > > and quickly figured out that the environment the timed code ru