[C++-sig] Boost.python suggestion + pyste bug

Niall Douglas s_sourceforge at nedprod.com
Mon Aug 11 00:36:09 CEST 2003

On 8 Aug 2003 at 0:01, Nicodemus wrote:

> >Lastly, am I right in thinking that pyste currently does not use
> >boost.python's ability to represent C++ class inheritance trees the
> >same in python classes? I'm thinking that if you were to add support
> >for this, it kinda works with the fixes necessary for fixing the bugs
> > above.
> What do you mean? It should export classes in the same way as if you
> were doing it by hand, but automatically. One difference is that it
> now automatically exports the members of base classes that were not
> exported themselves, as a feature request here in the list:
> struct A
> {
>     void foo();
> };
> struct B: A
> {
>     void bar();
> };
> If you export only B, you will get A's foo method too, as if you were
> exporting both A and B.

Firstly my apologies for the late reply, I've been laid up in bed 
these last few days with what looks like influenza. Odd given it's 
30C outside!

You're not quite understanding me. I shall illustrate:

If I have classes A, B & C where A inherits B and B inherits C, and I 
were exporting classes A and C to python, I should write:


class_<A, bases<C> >("A").def(...  // NOT bases<B>

Currently pyste does not generates bases<> for anything. I can 
understand this because it is complex - you must analyse what classes 
each interface file exports before being able to say what inherits 
what *also* *exposed*.

However if you've fixed those bugs I reported with some other method, 
then cool, I can do without this.


More information about the Cplusplus-sig mailing list