[pypy-dev] cppyy use case question

Alex Pyattaev alex.pyattaev at gmail.com
Thu May 31 01:09:20 CEST 2012


Hello,
I am considering trying cppyy on a large project, and I have a question.
I need to be able to add a reference to Python objects into the c++ classes. 
In essence:

#Python code:
x="My python object"

inst = cpp_class()
inst.add_data(x)
inst.do_stuff()#This does not modify x in any way
z=inst.get_data(x)

So, cpp_class acts as a container for python objects, and it does not need to 
know what kind of object is inside. I was able to make it work with pypy 
through basic C API, using SWIG and typemaps by mapping void* into PyObject*, 
but that is somewhat hackish. I am now thinking how would the same logic look 
with cppyy extension.	


PS:
building cppyy is pain in the ass... You guys seriously need to think about 
build logs =)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120531/466375c9/attachment.html>


More information about the pypy-dev mailing list