[Python-Dev] Breaking undocumented API
mal at egenix.com
Tue Nov 16 19:57:04 CET 2010
Alexander Belopolsky wrote:
> On Tue, Nov 16, 2010 at 1:06 PM, M.-A. Lemburg <mal at egenix.com> wrote:
>> Now, we can't use a macro for [PyUnicode_GetMax()], since the information has
>> to be available as callable in order to applications or extensions
>> to use it (without recompile).
> .. but it *is* a macro resolving to either PyUnicodeUCS2_GetMax or
That doesn't count :-) It's only a trick to prevent external code
from using the wrong Unicode APIs.
There still is a real function behind the renaming.
> What is the scenario when may want to change
> what PyUnicodeUCS?_GetMax return and have extensions pick up the
> change without a recompile?
If an extensions uses the stable ABI, it will want to know
whether the interpreter was built for UCS2 or UCS4 (even if
it doesn't use the Unicode APIs directly).
> UCS2 case will certainly never change
> since it is already 0xFFFF. Is it possible that USC4 will be expanded
> beyond 0x10FFFF?
Well, the Unicode Consortium decided to not go beyond 0x10FFFF,
but then you never know... when they started out on the quest,
16 bits appeared more than enough, but they found out relatively
quickly that the Asian scripts had enough code points to easily
fill that space.
Once space is available, it tends to get used sooner or later :-)
> Note that we can have both a macro and a function
> version. This is fairly standard practice in Python C-API.
Sure, but what for ?
Professional Python Services directly from the Source (#1, Nov 16 2010)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
::: Try our new mxODBC.Connect Python Database Interface for free ! ::::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
Registered at Amtsgericht Duesseldorf: HRB 46611
More information about the Python-Dev