[Python-Dev] Improvements for Porting C Extension from 2 to 3
Alexander Belopolsky
alexander.belopolsky at gmail.com
Thu Mar 3 17:37:18 CET 2011
On Thu, Mar 3, 2011 at 9:05 AM, Michael Foord <fuzzyman at voidspace.org.uk> wrote:
..
> I think its fair enough to point out the inconsistency in python-dev
> declaring that authors *should not* use certain parts of the C-API in
> extensions whilst using them in the extensions python-dev is responsible
> for...
This is not an inconsistency, but a balancing act. By using APIs that
are likely to change or be removed, we assume the responsibility to
clean up code that is under our control at some point in the future.
Users or 3rd party developers can do the same balancing, but the
assumption is that the amount of code in their libraries is much
greater than that in stdlib and they do not follow Python changes as
closely as core developers. These considerations usually tip the
scale towards not using private APIs. (For example, they don't and
should not run buildbots testing their code with the latest VC
checkout.)
On the other hand, if you can ship your application sooner using a hack like
#define PyString_AS_STRING _PyUnicode_AsString
more power to you, but you have been warned - don't file a bug report
when you code stops working with Python 3.5.
More information about the Python-Dev
mailing list