cppyy icon indicating copy to clipboard operation
cppyy copied to clipboard

pypy cannot pass function to cpp code while using cppyy?

Open dinghao188 opened this issue 2 years ago • 1 comments

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

dinghao188 avatar Jul 19 '22 06:07 dinghao188

Yes, I'm afraid the PyPy/_cppyy implementation is rather behind at this point.

wlav avatar Jul 19 '22 15:07 wlav