[pypy-dev] Re: Building a C extension that uses PyDictKeysObject on Pypy 3

2022-03-12 Thread Matti Picus



On 12/3/22 23:20, Marco Sulla wrote:

Hello. Sorry for posting in the dev mailing list, I did not found an user list 
for Pypy.

I developed a C extension for CPython 3.6+. This extension uses 
PyDictKeysObject. I tried to enable Pypy in cibuildwheel, but I get a 
compilation error for PyDictKeysObject.

What object can be used by C extension in Pypy instead of PyDictKeysObject?


This is the correct place to post, welcome. PyDictKeysObject is a 
CPython implementation detail, and not meant to be used even with 
CPython. The declaration is found in the cpython/Include/cpython/ 
directory. In general, we would recommend not writing c-extension 
modules for PyPy, rather providing a pure python version of your library 
since in 99% of cases it will be faster than going through the C-API 
emulation [0]. If you really have to use C, we would recommend you use 
CFFI [1] or CPPYY [2].



Matti



[0] 
https://www.pypy.org/posts/2018/09/inside-cpyext-why-emulating-cpython-c-8083064623681286567.html


[1] https://cffi.readthedocs.io/en/latest/

[2] https://cppyy.readthedocs.io/en/latest/

___
pypy-dev mailing list -- pypy-dev@python.org
To unsubscribe send an email to pypy-dev-le...@python.org
https://mail.python.org/mailman3/lists/pypy-dev.python.org/
Member address: arch...@mail-archive.com


[pypy-dev] Building a C extension that uses PyDictKeysObject on Pypy 3

2022-03-12 Thread Marco Sulla
Hello. Sorry for posting in the dev mailing list, I did not found an user list 
for Pypy.

I developed a C extension for CPython 3.6+. This extension uses 
PyDictKeysObject. I tried to enable Pypy in cibuildwheel, but I get a 
compilation error for PyDictKeysObject.

What object can be used by C extension in Pypy instead of PyDictKeysObject?
___
pypy-dev mailing list -- pypy-dev@python.org
To unsubscribe send an email to pypy-dev-le...@python.org
https://mail.python.org/mailman3/lists/pypy-dev.python.org/
Member address: arch...@mail-archive.com