Message243086
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. |
|
Date |
User |
Action |
Args |
2015-05-13 13:44:49 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, georg.brandl, rhettinger, r.david.murray, tdriscol, michael.henry |
2015-05-13 13:44:48 | serhiy.storchaka | set | messageid: <1431524688.93.0.485945867939.issue5633@psf.upfronthosting.co.za> |
2015-05-13 13:44:48 | serhiy.storchaka | link | issue5633 messages |
2015-05-13 13:44:48 | serhiy.storchaka | create | |
|