On 24.09.2015 18:36, Ken Seehart (kseehart) [CONT - Type 2] wrote:
>
> I have a python class that wraps a boost.python object. I am using a
> boost.python library function that requires the raw boost.python
> object. I want to be able to pass the python object to the boost api
> function.
>

I don't entirely understand what you are saying. What do you mean by
"boost.python object", and what by "boost.python library function" ?

Casting from Python to C++ types is typically done automatically by
Boost.Python.

To give an example:

You typcally start with a C++ class such as

    class Foo {...};

which is exposed to Python via the usual magic. Likewise, you may have a
C++ function taking "Foo" arguments (by value or by reference), which
equally can be exposed to Python.

In Python, you can manipulate objects of type "Foo" (including
subclassing Foo), and pass them to these functions, and Boost.Python
will take care of the required conversion.

Could you please outline in a little more detail what it is that you are
attempting to do ? It sounds to me like you might be missing some
fundamental aspects of what Boost.Python does, as explicit type
conversion is rarely necessary, in particular from the Python side.

Regards,
    Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...

_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
https://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to