Boost logo

Boost :

From: Achim Domma (achim.domma_at_[hidden])
Date: 2001-08-23 06:25:25


Hi,

is there a possibility to convert instances of objects, which are registert
in my module, to PyObjects*. The following works fine :

MyObjectA MyObjectB::mem_function(params) {
        MyObjectA retVal;
        ...
        return retVal;
}

but this way I can't return 'None'. So I tried the following:

PyObject* MyObjectB::mem_function(params) {
        MyObjectA retVal;
        if (ok)
                return retVal; // <- how to convert ???
        else
                return boost::details::none();
}

How can I get a PyObject out of my C++ Instance ? The same problem arrises
if I try to fill a python list with my own objects.

I tried to find a solution in the sources and via groups.google.com but
could not find anything. If there is a solution I would be absolutly happy
with as point I can start searching.

greetings
Achim


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk