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 Thanks
On 6/1/07, Sean Ross-Ross <srossross@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: http://boost.org/libs/python/doc/v2/extract.html boost::python::extract< something > ex( obj ); if( ex.check() ){ .... } else{ .... } 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 http://www.language-binding.net/
participants (2)
-
Roman Yakovenko -
Sean Ross-Ross