The forthcoming Python 3.2 implements PEP 384. The short description is at http://docs.python.org/dev/whatsnew/3.2.html:
"In the past, extension modules built for one Python version were often not usable with other Python versions. Particularly on Windows, every feature release of Python required rebuilding all extension modules that one wanted to use. This requirement was the result of the free access to Python interpreter internals that extension modules could use.
With Python 3.2, an alternative approach becomes available: extension modules which restrict themselves to a limited API (by defining Py_LIMITED_API) cannot use many of the internals, but are constrained to a set of API functions that are promised to be stable for several releases. As a consequence, extension modules built for 3.2 in that mode will also work with 3.3, 3.4, and so on. Extension modules that make use of details of memory structures can still be built, but will need to be recompiled for every feature release."
Could SWIG look into defining Py_LIMITED_API in future releases?
Naturally I have no clue whether this is feasible, but if it were, it would sure save me a lot of work (in about 4 years time!). Right now, I have to create 4 distinct installers for 4 versions of Python (2.5, 2.6, 2.7, 3.1). If the 3.2 installer worked with 3.3, 3.4, etc. that'd be great.
Log in to post a comment.