exec'ing functions
Mel Wilson
mwilson at the-wire.com
Fri Dec 10 10:10:14 EST 2004
In article <cpbm5v$803$05$1 at news.t-online.com>,
Peter Otten <__peter__ at web.de> wrote:
>Mel Wilson wrote:
>> The thing is, that once you drop local-namespace
>> optimization, the entire function gets slowed down, possibly
>> by 40%:
>It's not that bad as most of the extra time is spend on compiling the
>string.
[ ... ]
>def fib7(n, c=compile("a, b, i = 0, 1, n", "<nofile>", "exec")):
> exec c
[ ... ]
!
Regards. Mel.
More information about the Python-list
mailing list