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