[Python-Dev] Restricted API versioning (original) (raw)
Gregory P. Smith greg at krypto.org
Sat Jun 23 23:41:42 CEST 2012
- Previous message: [Python-Dev] Restricted API versioning
- Next message: [Python-Dev] Offer of help: http://bugs.python.org/issue10910
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sat, Jun 23, 2012 at 2:31 PM, "Martin v. Löwis" <martin at 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 PyLIMITEDAPI 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 PyTypeFromSpec couldn't support at all. So there is a new API function PyTypeFromSpecWithBases which covers this case, and this API will only be available in 3.3+.
Regards, Martin
Python-Dev mailing list Python-Dev at python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/greg%40krypto.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20120623/f437c4e8/attachment.html>
- Previous message: [Python-Dev] Restricted API versioning
- Next message: [Python-Dev] Offer of help: http://bugs.python.org/issue10910
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]