开发者

How to check if PyObject* points to the type numpy.uint8

开发者 https://www.devze.com 2023-03-23 03:33 出处:网络
How do I use the Python C-API to check if a PyObject* points to the type numpy.uint8 etc? (N开发者_运维知识库ote that I want to check if the PyObject* points to the type numpy.uint8, not if it point

How do I use the Python C-API to check if a PyObject* points to the type numpy.uint8 etc?

(N开发者_运维知识库ote that I want to check if the PyObject* points to the type numpy.uint8, not if it points to an instance of the type numpy.uint8.)


You can use PyType_IsSubtype(child, parent) to see if the child type inherits the parent, but it operates on PyTypeObject*, not PyObject*.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号