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

Jason Orendorff jason.orendorff at gmail.com
Fri Feb 23 17:29:02 CET 2007


On 2/22/07, Guido van Rossum <guido at python.org> wrote:
> If someone would like to volunteer a small PEP on the b"..." literal I
> would appreciate it.

I'll do this, unless someone tells me not to.  A few questions.

The grammar for string literals is already changing in py3k (removing
the tolerance of bogus escape sequences and the u"" prefix, I think).
Is the new grammar documented anywhere?  p3yk/Doc/ref/ref2.tex seems
to still have the 2.x grammar, and I didn't see anything in the PEPs.

How do you feel about raw byte-strings (br'a\b\c') and long
byte-strings (b'''...''')?

> The main concern here is that bytes objects are
> mutable; I think the right semantics will be that each time a b"..."
> literal is evaluated a *new* bytes object is created, just like [1, 2,
> 3] constructs a new list each time it is evaluated. The alternative
> would be a literal that could be modified in place, which reminds me
> of the worst of Fortran.

Yes, that seems clear.

-j


More information about the Python-3000 mailing list