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
HPyFieldin this mode. This should work, since it's annoying to have to define getters/setters manually here.