[Python-3000] Thoughts on new I/O library and bytecode

Guido van Rossum guido at python.org
Sat Feb 24 15:25:59 CET 2007


Georg is channeling me well. Also, my thinking has evolved some after
talking to various folks here at PyCon.

Georg, please check it in! Feel free to update the PEP if you will.

--Guido

On 2/24/07, Georg Brandl <g.brandl at gmx.net> wrote:
> Giovanni Bajo schrieb:
> > On 24/02/2007 11.20, Georg Brandl wrote:
> >
> >> Thomas Wouters schrieb:
> >>>
> >>> That's exactly what it does in current p3yk:
> >>>
> >>> Python 3.0x (p3yk:53867M, Feb 23 2007, 20:06:03)
> >>> [GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)] on linux2
> >>> Type "help", "copyright", "credits" or "license" for more information.
> >>>  >>> b"""abc
> >>> ... def"""
> >>> bytes([0x61, 0x62, 0x63, 0x0a, 0x64, 0x65, 0x66])
> >>
> >> Seeing that, I made a patch that makes bytes_repr output a bytes literal,
> >> see attached diff.
> >
> > I thought that the repr format of bytes was a deliberate choice to make life
> > harder to people trying to use bytes to handle text.
>
> That contradicts the "consenting adults" mantra. If a bytes object contains
> readable text (and that's not going to be exceptional), it should not be
> obscured -- in any case, I can just call str() on it and get my text.
>
> PEP 358 now states "Now that a b"..." literal exists, shouldn't repr()
> return one?" which suggests that the repr was the most canonical way
> to represent the bytes object at a time when there was no literal.
>
> Georg
>
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>


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


More information about the Python-3000 mailing list