Doing this boost::python::object obj = get_some_object(); if(obj) { //do something } seems to check a bool value inside the underlying PyObject, though I guess that could throw an exception if it doesn't contain actually contain a bool. Is that right? The reference documentation is not very clear about this: http://www.boost.org/doc/libs/1_42_0/libs/python/doc/v2/object.html
I had wrongly guessed that it would check if the underlying PyObject* was 0. I did this because I had wrapped a PyObject* in a boost::python::object for convenience, without checking for 0 first. Is there any correct way to check, other than doing if(obj.ptr()) ? And what's the correct way to check for PyNone other than if (obj == boost::python::object()) ? -- murr...@murrayc.com www.murrayc.com www.openismus.com _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org http://mail.python.org/mailman/listinfo/cplusplus-sig