[Python-3000] How will unicode get used?

Fredrik Lundh fredrik at pythonware.com
Sun Sep 24 14:42:55 CEST 2006


Martin v. Löwis wrote:

> I don't think reducing memory consumption is that important, for current
> hardware. Java and .NET have demonstrated that you can do "real"
> application with that approach.

I've spent more time optimizing Python's string types than most, and 
that doesn't match my experiences at all.  Operations on wide chars are 
often faster than one might think, but any processor can copy X bytes of 
data faster than it can copy X*4 bytes of data, and I doubt that's going 
to change soon.

> 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.

> Either alternative would produce many programming errors in extension
 > modules.

And even if that was true (which I don't believe), "many" would still
be "very small" compared to the problems that reference counting and 
error handling is causing.

</F>



More information about the Python-3000 mailing list