[I18n-sig] Re: [Python-Dev] Pre-PEP: Python Character Model

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 6 Feb 2001 22:16:38 +0100

> Before we go on: do you agree that we could add fopen and
> readtext/readbinary on various I/O types without breaking anything? 

That's a trivial question: Simply adding the functions will likely not
break anything, unless somebody else already had been using these

> And that that we should do so?

No. Your fopen is already available, and readtext/readbinary only work
on a per-file basis, not on a per-read basis.

> > This won't work: programs simply do not expect to get Unicode
> > characters out of chr() and would break. 
> Why would a program pass a large integer to chr() if it cannot handle
> the resulting wide string????

It won't. What it might do is to interpret the result as a byte
string, which would break depending on how exactly your new type
system works.

> No, the more we keep the worlds seperated the more code will be written
> that expects to deal with two separate types. We need to get people
> thinking in terms of strings of characters not strings of bytes and we
> need to do it as soon as possible.

For that, we need a patch first. Any volunteer attempting such a patch
risks being ignored, thus wasting his time. E.g. I invented a
Unicode-for-Python solution several years ago which was used
rarely. Marc-Andre developed one which was integrated in Python 2.0;
that is the one you want to tear down now. Why do yo think you will
have more luck?

In any case, I encourage you to try. I promise I will analyse your
patch and find its weaknesses with respect to existing applications
(I'm pretty sure there will be weaknesses).