On Tue, Feb 2, 2010 at 5:53 PM, peoro <peoro.n...@gmail.com> wrote: > Hello, > let me start by thanking everybody who's behind Boost.Python and Py++, > these projects are really awesome. > > I read that Py++ (and/or Boost.Python) has a native support for some > C++ containers, and that others can be added using indexing suites [ > http://www.language-binding.net/pyplusplus/documentation/containers.html > ]; was thus expecting a native conversions between C++ containers and > Python sequences. > For example, by exposing bindings for the following C++ function: > void f( const std::vector<int> &v ); > I supposed the next Python expression would have been valid: > mypackage.f( [1,2,3] ); > but actually it's not. > Only std::string gets automagically converted to/from str, other > supported containers can be explicitly casted to Python sequences (eg: > passing an exposed std::vector<int> to Python's "list", it works), but > not the other way around.
This subject was recently discussed on pygccxml mailing list: http://sourceforge.net/mailarchive/forum.php?thread_name=BAY127-W4F7525C7D12CD96F134EF8F640%40phx.gbl&forum_name=pygccxml-development > I've been trying to play with pyplusplus.module_builder, but cannot > find a way to allow native conversions, and google isn't being of help > either. > Is it possible to achieve native conversions, and, if it is, why is it > not done by default? Hope the posted link will clarify few things for you. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig