by kardos · 5y ago · 0 comments
In theory, most of the porting could be automated. The only thing which cannot is turning Py_INCREF/DECREF into HPy_Dup/HPy_Close: they are closely related, but HPy requires that you close each handle independently, contrarily to Python/C where you can DECREF the same PyObject* multiple times, as long as the final refcount is correct.
For that, the debug mode will be very useful because it precisely tells you which handles you didn't close and which ones you closed multiple times.