[Python-Dev] PEP 0404 and VS 2010

martin at v.loewis.de martin at v.loewis.de
Thu Nov 21 12:31:30 CET 2013


Quoting Nick Coghlan <ncoghlan at gmail.com>:

> Another alternative I'd prefer to an ABI version bump: backporting the "C
> runtime independence" aspects of the stable ABI to Python 2.7.

That sounds doable. If we provided a "python2.dll", would could make the
header files using the "restricted API" by default if Python is compiled
with VS 2010. Extension builders could then regularly compile their
extensions with VS 2010, or VS 2013, despite Python itself being linked
with the VS 2008 CRT.

Anybody releasing such binaries would either have to target Python 2.7.7,
or distribute "python2.dll" along with the binary. It should actually
be possible to provide a "python27vs2010.msi" upgrade package that
only deploys the python2.dll and the updated header files, on top of
an existing Python 2.7 installation.

I had originally planned to support the "stable ABI" in Python 2, but
the PEP lagged, and I couldn't finish it in time for the 2.7 release.

If Chris could contribute to make this happen, it would be much
appreciated.

Regards,
Martin

P.S. Thinking about this, there are some issues. The "restricted API"
hides the object layout of all objects, in particular of type objects.
Adding the PEP 384 API (PyType_FromSpec) might be a bit heavy for 2.7.

So it might by better to provide a "py27compat.dll" instead which does
not hide the structures (as they won't change during the remaining life
of 2.7), but only hides any APIs and macros that directly expose CRT
functionality.



More information about the Python-Dev mailing list