[C++-sig] [Boost.Python v3] handle, object, and PyObject*

2011-11-12 Thread Jim Bosch
Boost.Python has two smart-pointer-like classes for holding PyObject*. "handle<>" is more or less a customized intrusive_ptr, with the ability to be templated on other PyObject "derived" types (like PyTypeObject). The "object" hierarchy provides a much higher-level API, and defaults to Python's

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

2011-11-12 Thread Nat Goodspeed
On Nov 12, 2011, at 2:25 PM, Jim Bosch wrote: > On 11/12/2011 02:12 PM, Adam Preble wrote: >> Woooah that looks like it does work, although I had to interpret it like so: >> >> class DerivedTest(BaseTest): >> def __init__(self): >> BaseTest.__init__(self) Yes, sorry the email quoting conf

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

2011-11-12 Thread Jim Bosch
On 11/12/2011 02:12 PM, Adam Preble wrote: 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 t

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

2011-11-12 Thread Adam Preble
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

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

2011-11-12 Thread Nat Goodspeed
On Nov 12, 2011, at 11:34 AM, Adam Preble 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

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

2011-11-12 Thread Adam Preble
I am seeing this come up in many variations, with people doing slightly different things. I haven't yet seen an example doing something in this exact progression. I apologize here because I feel like I'm repeating a topic that has come up on the list before--even just a few weeks back. Here's wha