An idiom for code generation with exec

eliben eliben at
Tue Jun 24 07:18:47 CEST 2008

> If code generation is not the best, and I fail to see any performance issue
> that could explain such a choice, except a misunderstanding of
> what "compilation" means in python, just don't use it, use closures or
> callable instances, there are many way to achieve this.

And while we're on the topic of what compilation means in Python, I'm
not sure I fully understand the difference between compiled (.pyc)
code and exec-ed code. Is the exec-ed code turned to bytecode too,
i.e. it will be as efficient as compile-d code ?


More information about the Python-list mailing list