<br><br><div><span class="gmail_quote">On 2/21/07, <b class="gmail_sendername">Guido van Rossum</b> &lt;<a href="mailto:guido@python.org">guido@python.org</a>&gt; 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&#39;s preliminary -- it just calls the global name &#39;bytes&#39; currently (and not even using the &#39;right&#39; AST concretion mechanism) which means you can override what the bytes literal creates by assigning to &#39;bytes&#39; (although I&#39;m sure there&#39;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 &lt;<a href="mailto:jcarlson@uci.edu">jcarlson@uci.edu
</a>&gt; wrote:<br>&gt;<br>&gt; &quot;Jim Jewett&quot; &lt;<a href="mailto:jimjjewett@gmail.com">jimjjewett@gmail.com</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt; On 2/21/07, Guido van Rossum &lt;<a href="mailto:guido@python.org">
guido@python.org</a>&gt; wrote:<br>&gt; &gt; &gt; If the spelling of a bytes string with an ASCII character value is all<br>&gt; &gt; &gt; you are complaining about, you should have said so right away.<br>&gt; &gt;<br>&gt; &gt; That is my main objection.
<br>&gt; &gt;<br>&gt; &gt; A literal form does clear it up, though I&#39;m not sure &quot;b&quot; is the right<br>&gt; &gt; prefix.&nbsp;&nbsp;(I keep wanting to read &quot;binary&quot; or &quot;boolean&quot;, rather than<br>&gt; &gt; &quot;ASCII&quot;)
<br>&gt; &gt;<br>&gt; &gt; To be honest, it would probably be enough if there were an ascii<br>&gt; &gt; builtin, or if the example uses of the bytes constructor showed<br>&gt; &gt;<br>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; bytes(text)&nbsp;&nbsp; # no encoding
<br>&gt; &gt;<br>&gt; &gt; just copying the low-order byte, and raising exceptions if any<br>&gt; &gt; high-order bytes were non-zero.<br>&gt;<br>&gt; That&#39;s more or less changing the signature of bytes to be bytes(&lt;text&gt;,
<br>&gt; codec=&#39;ascii&#39;), but it breaks when faced with hex or octal escapes<br>&gt; greater than 127.&nbsp;&nbsp;Making it codec=&#39;latin-1&#39; is marginally better, but<br>&gt; having a default, regardless of the default, is begging for trouble
<br>&gt; (especially when dealing with unicode).<br>&gt;<br>&gt;&nbsp;&nbsp;- Josiah<br>&gt;<br>&gt; _______________________________________________<br>&gt; Python-3000 mailing list<br>&gt; <a href="mailto:Python-3000@python.org">Python-3000@python.org
</a><br>&gt; <a href="http://mail.python.org/mailman/listinfo/python-3000">http://mail.python.org/mailman/listinfo/python-3000</a><br>&gt; 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>&gt;<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 &lt;<a href="mailto:thomas@python.org">thomas@python.org</a>&gt;<br><br>Hi! I&#39;m a .signature virus! copy me into your .signature file to help me spread!