On Sat, Jun 23, 2012 at 2:31 PM, "Martin v. Löwis" <mar...@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 >
_______________________________________________ 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/archive%40mail-archive.com