[Pyrex] Does "exec" work in Pyrex?

Paul Prescod paul at prescod.net
Thu Jun 10 04:26:05 CEST 2004


> On Jun 9, 2004, at 2:26 PM, Phillip J. Eby wrote:
> 
>> At 11:22 AM 6/9/04 -0400, Edward C. Jones wrote:
>>
>>> Does "exec" work in Pyrex?
> 
> <snip> No. </snip>
> 
>> However, note that even if exec did "work" in the sense of allowing 
>> Python code to be run, it would:
>>
>> 1) not have access to the locals namespace, because C code doesn't 
>> have a namespace dictionary
>> 2) not execute Pyrex statements, because it's Python.

In theory Pyrex could build an appropriate locals dictionary "on demand".

And I would actually love it if it were possible to compile Pyrex code a 
line at a time so you could work with it in an interpreter shell as you 
do Python. Just because C programmers run C compilers by hand in batch 
mode does not mean that the rest of us have to. ;)

  Paul Prescod






More information about the Pyrex mailing list