<br><br><div><span class="gmail_quote">On 2/21/07, <b class="gmail_sendername">Guido van Rossum</b> <<a href="mailto:guido@python.org">guido@python.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Patch anyone?</blockquote><div><br>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.)
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On 2/21/07, Josiah Carlson <<a href="mailto:jcarlson@uci.edu">jcarlson@uci.edu
</a>> wrote:<br>><br>> "Jim Jewett" <<a href="mailto:jimjjewett@gmail.com">jimjjewett@gmail.com</a>> wrote:<br>> ><br>> > On 2/21/07, Guido van Rossum <<a href="mailto:guido@python.org">
guido@python.org</a>> wrote:<br>> > > If the spelling of a bytes string with an ASCII character value is all<br>> > > you are complaining about, you should have said so right away.<br>> ><br>> > That is my main objection.
<br>> ><br>> > A literal form does clear it up, though I'm not sure "b" is the right<br>> > prefix. (I keep wanting to read "binary" or "boolean", rather than<br>> > "ASCII")
<br>> ><br>> > To be honest, it would probably be enough if there were an ascii<br>> > builtin, or if the example uses of the bytes constructor showed<br>> ><br>> > bytes(text) # no encoding
<br>> ><br>> > just copying the low-order byte, and raising exceptions if any<br>> > high-order bytes were non-zero.<br>><br>> That's more or less changing the signature of bytes to be bytes(<text>,
<br>> codec='ascii'), but it breaks when faced with hex or octal escapes<br>> greater than 127. Making it codec='latin-1' is marginally better, but<br>> having a default, regardless of the default, is begging for trouble
<br>> (especially when dealing with unicode).<br>><br>> - Josiah<br>><br>> _______________________________________________<br>> Python-3000 mailing list<br>> <a href="mailto:Python-3000@python.org">Python-3000@python.org
</a><br>> <a href="http://mail.python.org/mailman/listinfo/python-3000">http://mail.python.org/mailman/listinfo/python-3000</a><br>> Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/guido%40python.org">
http://mail.python.org/mailman/options/python-3000/guido%40python.org</a><br>><br><br><br>--<br>--Guido van Rossum (home page: <a href="http://www.python.org/~guido/">http://www.python.org/~guido/</a>)<br>_______________________________________________
<br>Python-3000 mailing list<br><a href="mailto:Python-3000@python.org">Python-3000@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/python-3000">http://mail.python.org/mailman/listinfo/python-3000</a><br>
Unsubscribe: <a href="http://mail.python.org/mailman/options/python-3000/thomas%40python.org">http://mail.python.org/mailman/options/python-3000/thomas%40python.org</a><br></blockquote></div><br><br clear="all"><br>-- <br>
Thomas Wouters <<a href="mailto:thomas@python.org">thomas@python.org</a>><br><br>Hi! I'm a .signature virus! copy me into your .signature file to help me spread!