[Python-3000] How will unicode get used?
fredrik at pythonware.com
Mon Sep 25 18:01:21 CEST 2006
Martin v. Löwis wrote:
>>> I think supporting multiple representations at run-time would really
>>> be terrible. Any API of the "give me the data" kind would either have
>>> to expose the choice of representations, or perform a copy.
>> Unless you can guarantee that *all* external API:s that a Python
>> extension might want to use will use exactly the same internal
>> representation as Python, that's something that we have to deal with anyway.
> APIs will certainly allow different kinds of memory buffers to
> create a Python string object. Creation is a fairly small part
> of the API
creation is not the problem; it's the "give me the data" API that's the
problem. or rather, the "give me the data in a form that's compatible
with the 3rd party API that I'm about to call" API.
> I believe it would noticeably simplify the implementation if there is
> only a single internal representation.
and I, wearing my string algorithm implementor hat, tend to disagree
with that. writing source code that can be compiled into efficient code
for multiple representations is mostly trivial, even in C.
More information about the Python-3000