Lisandro Dalcin schrieb am 29.03.2015 um 12:23:
> One thing that Cython developers really need is PyPy defining a macro
> such as PYPY_VERSION_HEX in such a way us we can properly use
> conditional compilation. For example, a few days ago I was pushing
> PyPy fixes to Cython. I tried to use _PyLong_Sign in my patch, but the
> interpreter broke at runtime. This issue will be eventually fixed, I
> hope. Unce that happens, how can we know it is save to use the call
> for that pypy version and upwards? I mean, Cython should still support
> previous PyPy releases...

Yes, it's unfortunate that cpyext isn't versioned. But PY_VERSION_HEX
should still change sometimes over PyPy releases, so that might at least
help a bit.

In general, however, you shouldn't expect any CPython internals to work in
PyPy. Avoiding multiple C-API calls when a generic one exists is really the
best of all strategies. For example, why read just the sign, when you can
read the whole value? Everything else just risks aggregating slowness and
running into buggy corners.

That being said, if you find anything that can be optimised, I'm happy to
learn about your changes.

I think the general problem is that the PyPy developers loudly push for
cffi adoption, and improving anything in cpyext appears to undermine that
goal for them. So the current state of cpyext is a result of political
decisions, general dislikes and the usual OSS project lack of workpower.
Given all that, it actually works quite well. :)

Stefan

_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to