[C++-sig] Re : boost::python: C++/Python function overload issue

christophe jean-joseph jjchristophe at yahoo.fr
Thu Apr 19 00:55:02 CEST 2012



Hi,

here is my problem.

Let say have a C++ A class and a Ader class in Python, derived from A (through boost::python).
I have a list of functions f_i in Ader overloading the equivalent functions with same name in A.
The main is written in Python and call a method g of a C++ class B passing and argument of type Ader (it's written as A type under C++, but I don't have any type issue there).
Let say B::g call a function f_1, calling f_2, calling f_3. The error occur at f_3 as I could identify it uses A::f_3 instead of Ader::f_3.
By going down, I could confirm that, from f_1 to f_3, all the 3 called functions are the A version. 
So my question is, how can I fix this issue so that the B::g function uses Ader functions (meanning Python functions) and not A functions?
On a side, this is a C++/Python version of a code working fine when fully written in C++.

Christophe Jean-Joseph
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120418/8cc36f5c/attachment.html>


More information about the Cplusplus-sig mailing list