
On Tue, 23 Jun 2020 16:34:28 +0200 Victor Stinner vstinner@python.org wrote:
Le mar. 23 juin 2020 à 15:56, Petr Viktorin encukou@gmail.com a écrit :
Adding or removing members of C structures is causing multiple backward compatibility issues.
Adding a new member breaks the stable ABI (PEP 384), especially for types declared statically (e.g. ``static PyTypeObject MyType = {...};``).
PyTypeObject is explicitly not part of the stable ABI, see PEP 384: https://www.python.org/dev/peps/pep-0384/#structures I don't know why Py_TPFLAGS_HAVE_FINALIZE was added, but it wasn't for the PEP 384 stable ABI.
Maybe Antoine Pitrou knows the rationale why Py_TPFLAGS_HAVE_FINALIZE flag was added. Removing the flag was discussed at:
Mainly because some packagers (how many I don't know) had the habit of building a single extension DLL and distributing it for different Python versions on Windows.
It was much easier to add the flag than to pollute the PEP 442 discussion with a sub-discussion about the robustness of such ABI stability claims (which officially didn't exist, but were still relied on by some users / packagers).
Regards
Antoine.