Skip to content

Any way to access the PyTypeObject created by a class_? #3323

Answered by Skylion007
gmgunter asked this question in Q&A
Discussion options

You must be logged in to vote

Off the top of my head, you may be able to use PyBind11 type object through the py::type::of<MyClass>() feature: https://pybind11.readthedocs.io/en/stable/advanced/classes.html#accessing-the-type-object and then access the underlying PyTypeObject by calling .ptr() or .release().

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by henryiii
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants