[Python-3000] PEP 3138- String representation in Python 3000

Guido van Rossum guido at python.org
Thu May 22 19:55:01 CEST 2008


Hi folks,

Is this thread reaching a conclusion yet? I am hoping I can soon
accept some variant of the following:

1. repr() returns a Unicode string containing only printable Unicode
characters, using \x\u\U escapes for characters that are not
considered printable according to some version of the Unicode standard
augmented with some Python practicality, but unaffected by platform or
locale. This can be implemented efficiently, without having to load
the whole Unicode database, at least for strings containing only a
large subset of the Unicode character set (e.g. all of UCS2, and
possibly whole ranges of UCS4).

2. If you don't want any non-ASCII printed to a file, set the file's
encoding to ASCII and the error handler to backslashescape.

But as I haven't followed the thread I may be way off.

Is Martin's proposal to allow forcing the default stdin/stdout/stderr
encodings through environment variables related? (It should allow for
setting the error handler too.)

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


More information about the Python-3000 mailing list