Hi.
Does anyone have ideas how to convince boost::python to wrap
a container of boost::variant? I need this to generate
useful python bindings for a project of mine which uses boost::variant
internally. Since python supports heterogenous containers natively,
it seems to me this should be doable. However, I have attempted to find
a solution on my own on several occasions, and always failed.
One obvious hint is the indexing_suite. However, now that I looked at
it again, I think I know where the problem is: The get_item method of
indexing_suite always returns a data_type object, which is value_type
from the container in question. However, from what I can see, I'd need
something that converts to boost::python::object, so that I can return
whatever class is appropriate for the actual variant instance.
In other words, get_item would need to return a boost::python::object
instead of data_type.
To illustrate in code what I want, here is a minimal example:
#include