Possible to inspect type of a boost::python::object
Sept. 10, 2006
4:37 p.m.
Currently I'm using extract<T>::check() over a bunch of different types to decide what to do with python objects. Is there any way to inspect the type directly? A
September 2006
1:21 a.m.
"anders langlands" <anderslanglands@gmail.com> writes:
Currently I'm using extract<T>::check() over a bunch of different types to decide what to do with python objects. Is there any way to inspect the type directly?
You can inspect the _Python_ type directly: x.ptr()->ob_type; or if all the types have a common C++ base class with at least one virtual function, you can write: typeid(extract<Base*>(x)()) HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com
7187
Age (days ago)
7189
Last active (days ago)
1 comments
2 participants
participants (2)
-
anders langlands -
David Abrahams