Unicode question

Martin v. Löwis martin at v.loewis.de
Fri Jul 18 11:18:11 EDT 2003


Gerhard Häring <gh at ghaering.de> writes:

> I feel like an idiot now :-( I do get the warnings when I run a Python
> script, but I do not get the warnings when I'm using the interactive
> prompt. So it's all good (almost). Why not also produce warnings at
> the interactive prompt?

Because it is out of the scope of the PEP: The PEP is about source
code *files* only; interactive mode is completely different.

In source code, you can't know what the encoding is. In interactive
mode, you know it is the locale's encoding (assuming the computer is
correctly administrated).

In interactive mode, it would be tedious to enter an encoding
declaration, as you would have to do so over and over again. In source
code, it is not that bad, since you save the file, and the encoding
declaration stays in the file.

IOW, non-ASCII in string and Unicode literals should "just work" in
interactive mode. It currently doesn't fully work, but there is little
point in breaking what works for 2.3, just to restore it in 2.4.

Regards,
Martin





More information about the Python-list mailing list