(original) (raw)
On Sat, Jun 23, 2012 at 2:31 PM, "Martin v. L�wis" <martin@v.loewis.de> wrote:
I've been thinking about extensions to the stable ABI. On the one hand,
introducing new API can cause extension modules not to run on older
Python versions. On the other hand, the new API may well be stable in
itself, i.e. remain available for all coming 3.x versions.
As a compromise, I propose that such API can be added, but extension
authors must explicitly opt into using it. To define their desired
target Python versions, they need to set Py_LIMITED_API to the
hexversion of the first Python release they want to support.
Objections?
+1 This sounds reasonable to me. �Many other libraries have used this approach in the past.
The first use case of this are some glitches in the heap type API
that Robin Schreiber detected in his GSoC project. E.g. specifying
a heap type whose base also is a heap type was not really possible:
the type spec would have to contain a pointer to the base, but that
is not constant. In addition, if we use multiple interpreters, the
base type should be a different object depending on the current
interpreter - something that PyType\_FromSpec couldn't support at all.
So there is a new API function PyType\_FromSpecWithBases which covers
this case, and this API will only be available in 3.3+.
Regards,
Martin
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/greg%40krypto.org