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

Thomas Wouters thomas at python.org
Fri Feb 23 19:02:53 CET 2007


On 2/21/07, Guido van Rossum <guido at python.org> wrote:
>
> Patch anyone?


See attachement. It's preliminary -- it just calls the global name 'bytes'
currently (and not even using the 'right' AST concretion mechanism) which
means you can override what the bytes literal creates by assigning to
'bytes' (although I'm sure there's people out there that would love to keep
it that way ;-P) It should probably get its own bytecode (no pun intended.)

On 2/21/07, Josiah Carlson <jcarlson at uci.edu> wrote:
> >
> > "Jim Jewett" <jimjjewett at gmail.com> wrote:
> > >
> > > On 2/21/07, Guido van Rossum <guido at python.org> wrote:
> > > > If the spelling of a bytes string with an ASCII character value is
> all
> > > > you are complaining about, you should have said so right away.
> > >
> > > That is my main objection.
> > >
> > > A literal form does clear it up, though I'm not sure "b" is the right
> > > prefix.  (I keep wanting to read "binary" or "boolean", rather than
> > > "ASCII")
> > >
> > > To be honest, it would probably be enough if there were an ascii
> > > builtin, or if the example uses of the bytes constructor showed
> > >
> > >     bytes(text)   # no encoding
> > >
> > > just copying the low-order byte, and raising exceptions if any
> > > high-order bytes were non-zero.
> >
> > That's more or less changing the signature of bytes to be bytes(<text>,
> > codec='ascii'), but it breaks when faced with hex or octal escapes
> > greater than 127.  Making it codec='latin-1' is marginally better, but
> > having a default, regardless of the default, is begging for trouble
> > (especially when dealing with unicode).
> >
> >  - Josiah
> >
> > _______________________________________________
> > 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/)
> _______________________________________________
> 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/thomas%40python.org
>



-- 
Thomas Wouters <thomas at python.org>

Hi! I'm a .signature virus! copy me into your .signature file to help me
spread!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-3000/attachments/20070223/4a12c812/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bytesliteral.diff
Type: text/x-patch
Size: 7011 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20070223/4a12c812/attachment-0001.bin 


More information about the Python-3000 mailing list