检查boost :: python :: tuple的值是否为None

时间:2018-10-30 15:10:20

标签: python c++ boost

我正在尝试检查boost :: python :: tuple中的值是否为None。我有以下代码:

pbpaste

这给了我

namespace py = boost::python;

py::list ls(inf.Module().attr("data_out"));

for (int i = 0; i < len(ls); i++){     
    py::tuple tuple = py::extract<py::tuple>(ls[i]);
    if (tuple[1] == py::object()){  /* Does not work */
        //do other stuff
    }
}

有人可以帮我吗?

0 个答案:

没有答案