[C++-sig] cannot return boost::python::tuple

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu May 30 09:39:09 CEST 2002


--- David Abrahams <david.abrahams at rcn.com> wrote:
>     template <class T>
>     ref make_ref(T const& x)
>     {
>         return
> ref(boost::python::converter::callback_to_python<T>(x).get(),
> ref::increment_count);
>     }

This works great.

> As for returing a tuple, for the time being you must return a PyObject*.
> Adding the conversions will be relatively easy; it just has to get done.
> So, for now:
> 
>     return initargs.reference().release();

This works great, too.

And, cool, this works, too:

  boost::python::module("any")
    .setattr("__version__", boost::python::make_ref("1.2.3"));

What keeps you from including make_ref in reference.hpp?

Thanks,
        Ralf

P.S.: Did you notice my "constructor wrapper" question?


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com





More information about the Cplusplus-sig mailing list