[Python-Dev] Re: Re: Alternative Implementation forPEP292:SimpleString Substitutions

M.-A. Lemburg mal at egenix.com
Wed Sep 8 18:40:37 CEST 2004


Fredrik Lundh wrote:
> M.-A. Lemburg wrote:
> 
> 
>>>from a user perspective, there's no reason to make templates a sub-
>>>class of unicode, so the rest of your argument is irrelevant.
>>
>>Templates are meant to template *text* data, so Unicode is
>>the right choice of baseclass from a design perspective.
> 
> not true.  as I've shown in SRE and ElementTree (just to give a few
> examples), 8-bit strings are superior for the *huge* subset of all text
> strings that only contain ASCII data.
>
>>>instead of looking at use patterns, you're stuck defending the existing
>>>code.  that's not a good way to design usable code.
>>
>>Perhaps I'm missing something, but where would you use Templates
>>for templating binary data (where strings or bytes would be a more
>>appropriate design choice) ?
> 
> 
> 8-bit strings != binary data.
> 
> you clearly haven't read my other posts in this thread.  please do that,
> instead of repeating the same bogus arguments over again.

I've read them all and, to be honest, I don't follow your
argumentation.

The text interpretation of 8-bit strings is only one possible
form of their interpretation. You could just as well have image
data in your 8-bit string and calling .lower() on such a string is
certainly going to render that image data useless.

The whole point in adding Unicode to the language was to make
the difference between text and binary data clear and visible
at the type level.

I'm not saying that you can not store text data in 8-bit strings,
but that we should start to make use of the distinction between
text and binary data.

If we start to store text data in Unicode now and leave binary
data in 8-bit strings, then the move to Unicode strings literals
will be much smoother in P3k.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Sep 08 2004)
 >>> 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 mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list