[C++-sig] Re: Boost.Python: few thoughts and questions... [PATCH]
roman_sulzhyk at yahoo.com
Sat Jun 14 00:55:30 CEST 2003
--- Nicodemus <nicodemus at globalite.com.br> wrote:
> Roman Sulzhyk wrote:
> >Anyway, here's a patch with some rather raw hacks so far, if this
> >functionality is useful to Nicodemus I can definitely clean this up.
> >The patch is against stock 1.3.0 pyste.
> Looks great, thanks a lot Roman! I will apply the patch as soon as I
Just make sure to clean it up, it's a bit raw. I do think however that
it's probably worthwhile to change pyste internally to treat base
classes similarly to regular classes, because if you start exposing all
of the base classes member functions / member variables implicitely you
would have to change the way 'IsUnique()', 'members', and some other
things are handled...
> >1) Is it worthwhile to add a 'default reference policy' to pyste,
> >a default conversion (like copy_const_reference) which will be used
> >case one isn't specified explicitely. This will be useful for
> >situations where one has an API which returns a bunch of const
> >std::string &, to avoid having to specify them function by function.
> No, there isn't. But Pyste automatically uses copy_const_reference if
> member function returns something by constant reference... try using
> latest CVS.
Cool, that's great.
> >2) How about adding 'converter' functionality to pyste, i.e. ability
> >register default converters using to_python_converter<> ?
> That is indeed something that is missing. For pyste it is simple, we
> just need to provide a function to the user that inserts the specific
> code into the BOOST_PYTHON_MODULE:
> to_python_converter("converters::vector_to_list", "PyListType")
> Would generate:
> #include <my_converters.h>
> to_python_converter<converters::vector_to_list, PyListType>(); //
> from the top of my head
> Something like this would do?
Yep, something like this will do great.
> C++-sig mailing list
> C++-sig at python.org
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
More information about the Cplusplus-sig