[Cython] Cython 0.16: "eval" problem

Nathan Dunfield nmd at illinois.edu
Sun Apr 22 20:33:27 CEST 2012

On Apr 22, 2012, at 1:22 PM, Vitja Makarov wrote:
> Oops, it seems to be a problem with locals() dict creation. 

Yes it does.   The following variants of my original example both work:

## prob.pyx version 1

def cy_eval(s):
    return eval(s)

def f(x):
    cdef int* p
    return cy_eval(x)

## prob.pyx version 2

def f(x):
    cdef int* p
    return eval(x, {})



More information about the cython-devel mailing list