Re: [pypy-dev] Differences between pypy2 and 3 and cffi

2022-02-15 Thread Matti Picus
On Tue, Feb 15, 2022 at 3:36 AM Ioannis Foufoulas wrote: Hi, I have an embedded function: @ffi.def_extern() def toint(input,insize,result):     for i in range(insize):         x = ffi.string(input[i])         result[i] =  float(x) if x else 0       return 1 It

Re: [pypy-dev] Differences between pypy2 and 3 and cffi

2022-02-15 Thread Dan Stromberg
I doubt this is an expected result for Pypy3. But what if you use: result[i] = float(x) if x else 0.0 ...to make result be of homogeneous type? On Tue, Feb 15, 2022 at 3:36 AM Ioannis Foufoulas wrote: > Hi, > I have an embedded function: > > @ffi.def_extern() > def toint(input,insize,result):

Re: [pypy-dev] PyCodeObject incompatibility

2022-02-15 Thread Carl Friedrich Bolz-Tereick
Hi Dmitry, I can only reiterate, we would need some information about what that library is actually for to give more useful information at this point. As Matti said, most of these APIs cannot be usefully implemented in PyPy. most jitted functions do not *have* a filled frame object at all in PyPy

[pypy-dev] Differences between pypy2 and 3 and cffi

2022-02-15 Thread Ioannis Foufoulas
Hi, I have an embedded function: @ffi.def_extern() def toint(input,insize,result): for i in range(insize): x = ffi.string(input[i]) result[i] = float(x) if x else 0 return 1 It seems that this runs around 30-40% percent slower in PyPy3 than in 2. Input is a char** c ar