This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients georg.brandl, michael.henry, r.david.murray, rhettinger, serhiy.storchaka, tdriscol
Date 2015-05-13.13:44:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1431524688.93.0.485945867939.issue5633@psf.upfronthosting.co.za>
In-reply-to
Content
Definitely there is a bug. The code of timeit is written to support string stmt and callable setup. Expected that locals available when the function is created, would be available when the function is executed. But this doesn't work. May be it worked in the earlier Python, I don't know. Due to the lack of tests this was unnoticed.

Here is simpler patch that fixes the support of callable setup with string stmt.

But I like Tim's approach (compile testing function using the single template), it makes the implementation simpler. I'll try to adapt it for current sources.
History
Date User Action Args
2015-05-13 13:44:49serhiy.storchakasetrecipients: + serhiy.storchaka, georg.brandl, rhettinger, r.david.murray, tdriscol, michael.henry
2015-05-13 13:44:48serhiy.storchakasetmessageid: <1431524688.93.0.485945867939.issue5633@psf.upfronthosting.co.za>
2015-05-13 13:44:48serhiy.storchakalinkissue5633 messages
2015-05-13 13:44:48serhiy.storchakacreate