[Python-3000] locale-aware strings ?
Jim Jewett
jimjjewett at gmail.com
Mon Sep 4 05:14:18 CEST 2006
On 9/3/06, Guido van Rossum <guido at python.org> wrote:
> On 9/3/06, Jim Jewett <jimjjewett at gmail.com> wrote:
> > (2) To what extent will strings have an opaque
> > (or at least on-demand) backing store, so that
> > decoding/encoding could be delayed?
> That seems to be a bit of a leading question.
Yes; I (mis-?)read the original question as asking whether non-English
users would still be able to use (faster) 8-bit representations.
> BTW the term "backing store" is typically used for
> *disk-based* storage of large amounts of data --
> but (despite that your first question is about files)
> I don't believe this what you're referring to.
You are correct; I had forgotten that meaning, and was taking my usage
from the CFString (~= NSString) documentation suggested earlier.
There it refers to the underlying (private) real storage, rather than
to a disk.
Today, python unicode characters are limited to a specific fixed width
at compile time, because C extensions can operate directly on the data
buffer. If C extensions were required to go through the unicode
methods -- or at least to explicitly request a buffer -- then the
underlying storage could (often) be far more efficient.
This privatization would, however, be a major change to the API.
Smaller and faster localized strings are one of the compensatory
benefits.
-jJ
More information about the Python-3000
mailing list