-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support object members #347
Conversation
What happens during porting a C extension? Presumably initially the member is a I am wondering whether we need a legacy_defines or similar? Or at least some way to make it clear "these object members should use HPyField and those should use PyObject*". |
As long as it is a PyObject*, compilation in universal mode just fails. After it is an HPyField, it works in both CPython C ABI mode and HPy universal mode. It even works to have an HPyField and still use the legacy definition for members, since then you have to compile in C ABI mode and the HPyField is binary equivalent to PyObject* in that mode. So afaics, nothing can go wrong even if you just partially port. |
We already define
HPyMember_OBJECT
, but using it infails in universal mode, as the included test demonstrates, since the embedded member must an
HPyField
in this mode. This should work, since it's annoying to have to define getters/setters manually here.