Re: [Cython] Cython 0.16: "eval" problem

2012-04-23 Thread Vitja Makarov
2012/4/22 Vitja Makarov : > 2012/4/22 Nathan Dunfield : >> 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)

Re: [Cython] Cython 0.16: "eval" problem

2012-04-22 Thread Vitja Makarov
2012/4/22 Nathan Dunfield : > 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):

Re: [Cython] Cython 0.16: "eval" problem

2012-04-22 Thread Nathan Dunfield
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) ## p

Re: [Cython] Cython 0.16: "eval" problem

2012-04-22 Thread Vitja Makarov
2012/4/22 Nathan Dunfield : > With Cython 0.15, the following works with Python 2.7: > > ### start file: prob.pyx > > def f(x): >    cdef int* p >    return eval(x) > > ### end file > import pyximport; pyximport.install() import prob prob.f("5") > 5 > > but with Cython 0.16 it doesn'