[C++-sig] create a python object from scratch in boost.python?

Nikolay Mladenov nikolay.mladenov at gmail.com
Tue Jan 21 14:55:16 CET 2014


My be construct bp::object from the result of _PyObject_New?


On Tue, Jan 21, 2014 at 8:29 AM, Gary Oberbrunner <garyo at genarts.com> wrote:

>
>
> ----- Original Message -----
> > From: "Neal Becker" <ndbecker2 at gmail.com>
> > To: cplusplus-sig at python.org
> > Sent: Monday, January 20, 2014 8:39:55 PM
> > Subject: Re: [C++-sig] create a python object from scratch in
> boost.python?
> >
> > Gary Oberbrunner wrote:
> >
> > > I'd like to create a python object with some attributes in C++, and
> > > return it
> > > to python. ...  Instead of None, I'd like to create a
> > > simple empty
> > > python class I can add attributes to....
> >
> > I think if you've exposed your c++ class, then there is a conversion
> > from c++ object to python object.  So
> >
> > bp::object plugin (Plugin_Info());
>
> Thanks -- I can indeed do that (or a proxy C++ class in any case).  I was
> wondering though if it's possible to create an anonymous python class in
> BP, without a "starter" C++ class as it were.  But I suppose that's mostly
> an academic question right now.
>
> --
> Gary Oberbrunner
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> https://mail.python.org/mailman/listinfo/cplusplus-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20140121/89c9499d/attachment.html>


More information about the Cplusplus-sig mailing list