
This may potentially be unrelated to Boost.Python, but how to do an
equivalent of C++ dynamic_cast in Python, having all the classes wrapped
using boost.python? See below:
// All the components inherit from Component
class Component { };
class ComponentA: public Component { };
class ComponentB: public Component { };
// Find a component by name
Component *FindComponent(const char *name);
// In C++ result of FindComponent may be dynamic_casted to appropriate type:
void f()
{
Component *c = FindComponent("a");
ComponentA *a = dynamic_cast