[pypy-dev] For embedding pypy, how to deal with None value

Yicong Huang hengha.mao at gmail.com
Tue May 19 17:06:51 CEST 2015


The document Embedding PyPy shows good examples, but did not tell how to
deal with None value.
As Python support None value, it might bring some troubles:
1. How to pass NULL from C to python for None?
2. If python function return None, how to handle the issue in C?

For the above cases, we observed errors like these:

>From cffi callback <function add_numbersInt at 0x00007f25f313e110>:
Trying to convert the result back to C:
TypeError: expected integer, got NoneType object
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150519/c84831b1/attachment.html>


More information about the pypy-dev mailing list