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

M.-A. Lemburg mal at egenix.com
Thu May 22 21:11:56 CEST 2008


On 2008-05-22 19:55, Guido van Rossum wrote:
> 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.

Sounds like a good compromise.

Just please don't set the error handler of sys.stdout to anything but
"strict" per default.

> 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.)

It's not related, but would be very helpful on its own, esp. for
the stdin part in 3.x.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, May 22 2008)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

:::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,MacOSX for free ! ::::


    eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
     D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
            Registered at Amtsgericht Duesseldorf: HRB 46611


More information about the Python-3000 mailing list