[pypy-dev] cppyy and callbacks
Alex Stewart
foogod at gmail.com
Fri Jan 17 22:12:27 CET 2014
>
> For global functions, I've found helper with void* + cffi (the way you've
> described in your mail) enough.
Ok, so I think I'm really close to having something working now, except for
one thing: I can't figure out how to access/pass a void pointer via cppyy?
If I declare a C++ function/method as taking a "void *" argument, I can't
figure out how to construct a Python object/value to pass to it that it
will accept (whatever I try (for example, when trying an int, such as what
cppyy.addressof returns), I just get "TypeError: 'CPPInstance' object
expected, got 'int' instead").. Is there some special way to construct a
cppyy "void *" object or something I'm not aware of?
I also noticed when I tried defining a global "void *" variable, like so:
void *voidp;
That any attempt to access it from Python yields:
>>>> cppyy.gbl.voidp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: <class '__main__.::'> object has no attribute 'voidp'
(details: no converter available for '')
This feels like I must be missing something obvious here..?
--Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20140117/d82d9e9f/attachment.html>
More information about the pypy-dev
mailing list