cppyy
cppyy copied to clipboard
pypy cannot pass function to cpp code while using cppyy?
i am using pypy+cppyy, and the code is below
import cppyy
cppyy.cppdef("""
void hello(void (*f)()) { f(); }
""")
def hello_from_py():
print("Hello PyPy")
cppyy.gbl.hello(hello_from_py)
the output is a error,
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'CPPOverload' object expected, got 'function' instead
Yes, I'm afraid the PyPy/_cppyy implementation is rather behind at this point.