How to dynamically create a derived type in the Python C-API

后端 未结 3 852
余生分开走
余生分开走 2021-01-30 10:17

Assume we have the type Noddy as defined in the tutorial on writing C extension modules for Python. Now we want to create a derived type, overwriting only the

3条回答
  •  遇见更好的自我
    2021-01-30 10:53

    One way to try and understand how to do this is to create a version of it using SWIG. See what it produces and see if it matches or is done a different way. From what I can tell the people who have been writing SWIG have an in depth understanding of extending Python. Can't hurt to see how they do things at any rate. It may help you understand this problem.

提交回复
热议问题