[Zope3-dev] Re: [Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate - TALES.py:1.3

Guido van Rossum guido@python.org
Fri, 14 Jun 2002 15:21:28 -0400


[Changing the audience]

> > I've heard this recommendation again, and I still don't understand
> > what you expect this to buy us.  I've checked, and there's not a
> > single non-ASCII character in the entire Zope 3 Python source, so it
> > would have no impact.
> 
> Not necessarily in the code, but the data we save. Let's say you mix at some 
> point some info from the source and the data storage *be it ZODB or gettext 
> file). If your strings are not in the right format you run in all sorts of 
> problems. I guess only developers who have been in unicode hell once, 
> understand... :-)

Sounds like FUD to me.  Maybe mixing string types causes problems in
other languages, but Python's rules for combining ASCII and Unicode
strings are designed to make mixing of the two always do the right
thing.  (OTOH, mixing Latin-1 or any other 8-bit string encoding with
Unicode also does "the right thing" -- it raises an exception.)

> > And what makes a text string?  
> 
> Good question. That needs to be well defined and really depends on several 
> factors. The easiest way is to check whether a string cane ever contain 
> unicode chars.
> 
> > Is a filename a text string?
> 
> Well, can filenames contain unicode characters?
> 
> > A Python attribute name?  
> 
> No, sinc ethey can only contain ASCII.
> 
> > An XML attribute name?
> 
> Definitely, since the XML standard says that everything in XML can contain 
> unicode strings. (I think.)

I still think that making all literals u"" literals is a YAGNI.
Please don't do this until we've given this a lot more thought.

--Guido van Rossum (home page: http://www.python.org/~guido/)