[Python] Custom __getattr__ with different CallPolicy for different return values
Hi,
I would like to custom __getattr__ for my class such that for some
attributes, an internal reference is returned, and for others, a new object
is returned.
I cannot hardcode the attributes as they are dynamic.
I started writing something like:
boost::python::object myGetAttr(boost::python::object obj, std::string
const& attr)
{
MyObj* mobj = boost::python::extract
participants (1)
-
H Krishnan