Using code objects?

Konstantin Veretennicov kveretennicov at gmail.com
Tue Jun 21 09:56:27 EDT 2005


On 6/21/05, Chinook <chinook.nr at tds.net> wrote:
> 
> When I create the code objects though, it seems a couple different ways work
> and I'm wondering which is better and why (or is there a more correct
> technique in this situation)?
> 
> The two different ways are illustrated below:
...
> >>> obj1 = compile(exp1, 'whatever', 'single')
...
> >>> obj2 = compile(exp2, 'whatever', 'exec')

Are you essentially asking about difference between compile(..., 'single') 
and compile(..., 'exec'), which is described in
http://docs.python.org/lib/built-in-funcs.html ?

- kv



More information about the Python-list mailing list