[Python-Dev] Restricted API versioning

Brett Cannon brett at python.org
Sat Jun 23 23:41:06 CEST 2012


On Sat, Jun 23, 2012 at 5: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 Py_LIMITED_API to the
> hexversion of the first Python release they want to support.
>
> Objections?
>

Nope, it sounds like a good idea to allow for the ABI to slowly grow.

-Brett


>
> 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 at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/brett%40python.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20120623/060af72c/attachment.html>


More information about the Python-Dev mailing list