[C++-sig] Fwd: Passing Python-derived class back into a native C++ class doesn't match the C++ signature

Adam Preble adam.preble at gmail.com
Sat Nov 12 20:12:27 CET 2011


Woooah that looks like it does work, although I had to interpret it like so:

class DerivedTest(BaseTest):
  def __init__(self):
    BaseTest.__init__(self)

  def GimmeNumber(self):
    return 100

I don't really consider myself an expert on these things, though I was
Googling around on the proper way to handle the inheritance construction in
Python.  Is this kind of the normal rigors when subclassing in Python
normally, or is this something I must particularly pay attention to when
using Boost?

On Sat, Nov 12, 2011 at 1:02 PM, Nat Goodspeed <nat at lindenlab.com> wrote:

> On Nov 12, 2011, at 11:34 AM, Adam Preble <adam.preble at gmail.com> wrote:
>
> > I am seeing this come up in many variations, with people doing slightly
> different things.
>
> I have no direct experience with this issue myself, but I can parrot a bit
> of advice I've read here before.
>
> > In Python:
> > class DerivedTest(BaseTest):
> >     def __init__(self):
>         BaseTest.__init__(self)
> >         pass
> >
> >     def GimmeNumber(self):
> >         return 100
> _______________________________________________
> 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/20111112/f2c0e4ef/attachment.html>


More information about the Cplusplus-sig mailing list