gh-120600: Make Py_TYPE() opaque in limited C API 3.14 (#120601)

In the limited C API 3.14 and newer, Py_TYPE() is now implemented as
an opaque function call to hide implementation details.
This commit is contained in:
Victor Stinner 2024-06-18 16:28:48 +02:00 committed by GitHub
parent e8752d7b80
commit 16f8e22e7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 40 additions and 9 deletions

View file

@ -3001,3 +3001,11 @@ Py_GetConstantBorrowed(unsigned int constant_id)
// All constants are immortal
return Py_GetConstant(constant_id);
}
// Py_TYPE() implementation for the stable ABI
#undef Py_TYPE
PyTypeObject* Py_TYPE(PyObject *ob)
{
return _Py_TYPE(ob);
}