[C++-sig] extract

Roman Yakovenko roman.yakovenko at gmail.com
Sat Jun 2 11:41:36 CEST 2007

On 6/1/07, Sean Ross-Ross <srossross at gmail.com> wrote:
> hi,
> How do I write multiple to_python conversions?
> Say I have an boost::python::object and I call extract<somthing>,
> where  the object could be a "c++ somthing class" or a Python dictionary

I guess you should read "extract" documentation:

boost::python::extract< something > ex( obj );
if( ex.check() ){

I didn't try this for boost::python::dict class. If this will not
work, you can always use "isinstance" functionality.
Roman Yakovenko
C++ Python language binding

More information about the Cplusplus-sig mailing list