[Python-Dev] Unicode

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Sun, 14 May 2000 23:39:52 +0200


> comments?  (for obvious reasons, I'm especially interested in comments
> from people using non-ASCII characters on a daily basis...)

> nobody?

Hi Frederik,

I think the problem you try to see is not real. My guideline for using
Unicode in Python 1.6 will be that people should be very careful to
*not* mix byte strings and Unicode strings. If you are processing text
data, obtained from a narrow-string source, you'll always have to make
an explicit decision what the encoding is.

If you follow this guideline, I think the Unicode type of Python 1.6
will work just fine.

If you use Unicode text *a lot*, you may find the need to combine them
with plain byte text in a more convenient way. This is the time you
should look at the implicit conversion stuff, and see which of the
functionality is useful. You then don't need to memorize *all* the
rules where implicit conversion would work - just the cases you care
about.

That may all look difficult - it probably is. But then, it is not more
difficult than tuples vs. lists: why does

>>> [a,b,c] = (1,2,3)

work, and

>>> [1,2]+(3,4)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: illegal argument type for built-in operation

does not?

Regards,
Martin