[Python-Dev] Python API version & optional features

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri, 3 Aug 2001 08:24:02 +0200


> Shouldn't Python automatically Do The Right Thing in that case? That
> would mean wrapping the UCS4 calls in a conversion layer, which
> isn't hard. I mean, it's just a question of adding or taking away
> zeroes, right? :)

Given the smiley at the end of your message, I don't know whether you
meant your point seriously or not.

I believe it is impossible for Python to do what you seem to think as
the "Right Thing". E.g. modules that use PyUnicode_AS_UNICODE will
behave differently when sizeof(Py_UNICODE) changes. Since this is a
macro, you cannot change their behavior at run-time; they have
assumption on the size of Py_UNICODE compiled-in.

Regards,
Martin