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

Nick Coghlan ncoghlan at gmail.com
Tue May 6 16:10:43 CEST 2008


Atsuo Ishimoto wrote:
>>  I proposed to make the Unicode repr() output a regular encoding
>>  that's being implemented by a codec. You could then easily
>>  change the encoding to whatever you need for your application
>>  or console.
> 
> I think global setting is not flexible enough. And I see no benefit to
> customizable repr() except to keep compatible with Python 2, but I
> think it is easy to migrate the existing code to the Py3k.

There's a bigger issue with trying to make whatever repr() does a codec 
in Py3k. As a Unicode->Unicode transformation, it doesn't mesh well with 
Py3k's strict Unicode->bytes/bytes->Unicode encoding/decoding philosophy.

That said, it would be nice to have a way to easily stack 
Unicode->Unicode transforms on top of text IO streams, or byte->byte 
transforms on top of binary streams.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list