Python 使绑定了解祖先绑定 我有一个从类库派生的C++类。
Python 使绑定了解祖先绑定 我有一个从类库派生的C++类。,python,c++,perl,swig,Python,C++,Perl,Swig,class Derived : public LargeLibrary::ParentWithHugeInterface { // add some methods // override some other methods }; 这个库有自己的Python和Perl绑定(使用SWIG创建)。现在我想为我自己的类创建类似的绑定。我是否可以让我的绑定知道LargeLibrary的遗留内容,以便将派生的与LargeLibrary的方法一起使用,并获取其父接口 更新: 我找到了Python
class Derived : public LargeLibrary::ParentWithHugeInterface
{
// add some methods
// override some other methods
};
这个库有自己的Python和Perl绑定(使用SWIG创建)。现在我想为我自己的类创建类似的绑定。我是否可以让我的绑定知道LargeLibrary
的遗留内容,以便将派生的与LargeLibrary
的方法一起使用,并获取其父接口
更新:
我找到了Python的PyTypeObject*PyTypeObject.tp_base
slot,但是我仍然不知道如何使用它 最后,我找到了解决办法
只需在接口文件中添加%import“LargeLibrary.i”
即可