Cpython has a feature that allows you to call c-api functions from
python via ctypes.pythonapi It doesn't currently work on pypy, I started to document why not on the disable_pythonapi branch: ``ctypes.pythonapi`` lets you access the CPython C API emulation layer. It does not work on PyPy at the moment, we are missing a ``getfunc`` method for CDLL. Work was begun to refactor the rpython implementation of _rawffi (in pypy/modules/_rawffi/alt) but that project has stalled. Note that even if it worked, our implementation would not do anything sensible about the GIL and the functions will be named with an extra "Py", for example ``PyPyInt_FromLong()``. Basically, don't use this. Assuming the PyObject pointers you get have any particular fields in any particular order is just going to crash. but since it is such a bad idea, can we just disable it instead of fixing? In Favor of disabling: no need to extend _rawffi, only remove some code and fix tests Against disabling: another obscure cpython incompatability Matti |
_______________________________________________ pypy-dev mailing list pypy-dev@python.org https://mail.python.org/mailman/listinfo/pypy-dev