[issue2527] Pass a namespace to timeit

Peter Otten report at bugs.python.org
Wed Apr 2 08:42:08 CEST 2008


Peter Otten <__peter__ at web.de> added the comment:

Alexander, I'm fine with a more specific argument name. ns was what 
the Timer already used internally.

Antoine, from __main__ import name1, ..., nameN works fine on the 
command line, but inside a function you'd have to declare the names 
you want to pass to the Timer as globals which I find a bit clumsy. 
Apart from giving a syntax warning a star-import affects the generated 
bytecode and produces the (slower) LOAD_NAME instead of LOAD_FAST.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2527>
__________________________________


More information about the Python-bugs-list mailing list