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

christophe jean-joseph jjchristophe at yahoo.fr
Fri Apr 20 17:15:52 CEST 2012



Thank you very much.
I knew the link already but it made me read my code again and realize that I forgot to reflect the overloaded functions with boost::python.

Christophe Jean-Joseph



________________________________
 De : JS Unkn0wn <jsperf.unkn0wn at gmail.com>
À : christophe jean-joseph <jjchristophe at yahoo.fr>; Development of Python/C++ integration <cplusplus-sig at python.org> 
Envoyé le : Jeudi 19 avril 2012 1h21
Objet : Re: [C++-sig] Re : boost::python: C++/Python function overload issue
 

Does this (  http://www.boost.org/doc/libs/1_49_0/libs/python/doc/tutorial/doc/html/python/exposing.html  ) answer your question? specifically "Class Virtual Functions".


On Wed, Apr 18, 2012 at 11:55 PM, christophe jean-joseph <jjchristophe at yahoo.fr> wrote:


>
>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
> 
>_______________________________________________
>Cplusplus-sig mailing list
>Cplusplus-sig at python.org
>http://mail.python.org/mailman/listinfo/cplusplus-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120420/7fcd463b/attachment.html>


More information about the Cplusplus-sig mailing list