Re: [C++-sig] [Boost Python] Cannot call base method from within python extended class method

2015-01-13 Thread Tiago Coutinho
Hi, On Tue, 2015-01-13 at 12:13 +0100, Holger Joukl wrote: > Hi, > > > For ElementWrap::get_float, try: > > float get_float() { return this->get_override("get_float")(); } > > > > Binding to Python of that function should then be: > > .def("get_float", pure_virtual(&Element::get_float)) > > > > S

[C++-sig] [Boost Python] Cannot call base method from within python extended class method

2015-01-09 Thread Tiago Coutinho
Hello, My problem is the following: I am trying to bind a third party C++ library to python using boost-python. This library has a class Element and a class Owner (the later takes ownership of an Element object). To make things interesting, Element defines a pure virtual method "get_float". The

[C++-sig] ownership of C++ object extended in Python

2012-12-20 Thread Tiago Coutinho
Hello all, I want to export a class 'A' from an external library to python. In python I need to extend the class and I need to tell the library that it will 'own' the object. I have tried the example in: http://wiki.python.org/moin/boost.python/HowTo (chapter "ownership of C++ object") And exe