[C++-sig] pyplusplus howto?

Roman Yakovenko roman.yakovenko at gmail.com
Mon Feb 13 14:38:36 CET 2006


On 2/13/06, David Abrahams <dave at boost-consulting.com> wrote:
> > 1. Using pyplusplus you setup few rules. Rules that say what
> > declaration to expose.
> > After this, if you add new functionality/declaration and it fits those
> > rules, it will be exposed.
>
> SWIG users will appreciate that.

:-)

> > 2. An other difference: when pyplusplus creates bindings for a set of
> > declarations, it
> > should (?) see all declarations that are going to be exported:
> >     reasons:
> >         to decide what class holder is.
> >             In one header file you define class, in an other you
> > define function that takes
> >             as argument shared_ptr to the class.
>
> You don't need to use a shared_ptr holder for that purpose.  The
> *only* reason you'd ever want to use a share_ptr holder is if you
> expect people to wrap functions taking non-const references to these
> shared_ptrs.  That is very rare -- it only happens when users want to
> replace one shared_ptr with another (possibly NULL) shared_ptr.

Note taken.

> >         to expose free operators as class methods:
> >             As you know C++ allows to redefine operators in to ways:
> >                  as class members
> >                  as free operators
> >            pyplusplus inject those free operators as class members to
> > exported class.
>
> You could always do that after-the-fact.

I don't understand you. What do you mean after-the-fact?

> There's absolutely no reason
> that all a (Python wrapped) class' methods need to be exposed in the
> same translation unit.

Now, I understand this. I hope, that with Allen help I could design
and implement
nice interface that will do it.

> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
>

Thanks.

--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list