Re: timeit and __future__

2009-06-20 Thread Steven D'Aprano
Karl Chen wrote: > > I wanted to time something that uses with_statement, in python2.5. > Importing __future__ in the statement or the setup doesn't work > since it's not the beginning of the code being compiled. Other > than using a separate module, I could only come up with this: > > time

timeit and __future__

2009-06-19 Thread Karl Chen
I wanted to time something that uses with_statement, in python2.5. Importing __future__ in the statement or the setup doesn't work since it's not the beginning of the code being compiled. Other than using a separate module, I could only come up with this: timeit.template = 'from __future__ i