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

Guido van Rossum guido at python.org
Wed May 14 18:55:28 CEST 2008


On Wed, May 14, 2008 at 9:33 AM, Georg Brandl <g.brandl at gmx.net> wrote:
>  Will this get use the hex, base64 etc. "codecs" back? If yes, great!

If someone does the work, yes. There will need to be some way to add
metadata to codecs to indicate which of the following they support:
str<->bytes, str<->str, bytes<->bytes.

M.-A. Lemburg schrieb:
> > Fine, so we need new methods for PyUnicode and PyString objects
> > which allow encoding and decoding using the same type (and enforce
> > the return types).
> >
> > Any suggestions ?
> >
> > How about these:
> >
> > str.str_encode() -> str
> > str.str_decode() -> str
> >
> > bytes.bytes_encode() -> bytes
> > bytes.bytes_decode() -> bytes

>  Cool, a naming contest :)
>
>  What about transform/untransform?

+1, anything to avoid having to type underscores.

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


More information about the Python-3000 mailing list