timeit module: am I missing something obvious?

2006-02-20 Thread Steven D'Aprano
When using the timeit module, you pass the code you want to time as strings: import timeit t = timeit.Timer(foo(x, y), \ from module import foo x = 27 y = 45 ) elapsed_time = t.timeit() This is all very well, but it feels quite unnatural to me. Why am I passing strings around when functions

Re: timeit module: am I missing something obvious?

2006-02-20 Thread Peter Otten
Steven D'Aprano wrote: When using the timeit module, you pass the code you want to time as strings: import timeit t = timeit.Timer(foo(x, y), \ from module import foo x = 27 y = 45 ) elapsed_time = t.timeit() This is all very well, but it feels quite unnatural to me. Why am I

Re: timeit module: am I missing something obvious?

2006-02-20 Thread Dan Christensen
Peter Otten [EMAIL PROTECTED] writes: Steven D'Aprano wrote: When using the timeit module, you pass the code you want to time as strings: ... This is all very well, but it feels quite unnatural to me. Why am I passing strings around when functions are first class objects? Have I missed