[C++-sig] How to create and return a new instance of a Python Exported C++ class.

pj pjdurai at hotmail.com
Fri May 23 22:02:41 CEST 2003


Greetings.

I am using boost-python to write a python extension and export some of my
C++ class.

I cant quite figure out how to do this.

class AA {}    -> Exported to Python using class_  construct. No problems
here.

I am wring another C++ class BB (just for this extension, new code)  which
too has to be exported to Python , in which, I want to create and return a
Python-AA object.

class BB
{
    GetMeAA ( )
    {
        // When called from python this needs to create and return a
Python-AA object.
    }
};


How would I write this member function, and how would I export it ?
I suspect I am missing something rudimentary. But no clue yet to what.

Appreciate your time.

cheers
pj









More information about the Cplusplus-sig mailing list