<div class="gmail_quote">On Wed, Jul 1, 2009 at 9:48 AM, James Henstridge <span dir="ltr">&lt;<a href="mailto:james@jamesh.id.au">james@jamesh.id.au</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Wed, Jul 1, 2009 at 10:44 PM, Gustavo Niemeyer&lt;<a href="mailto:gustavo@niemeyer.net">gustavo@niemeyer.net</a>&gt; wrote:<br>
&gt;&gt; Actually, Python 2.6 doesn&#39;t have a separate bytes type.  It is just<br>
&gt;&gt; an alias for the existing byte string type:<br>
&gt;<br>

[...]</div>I know that there were behaviour changes.  What I&#39;m getting at is that<br>
there are no versions of Python that have both a &quot;str&quot; and &quot;bytes&quot;<br>
type<br>
<div class="im"></div></blockquote><div> </div></div>James:<br>
  I don&#39;t think what you said what you meant... <br>
See the following...<br><br>&lt;console dump&gt;<br>C:\Users\vernon&gt;c:\python31\python.exe<br>Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on wi32<br>Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.<br>
&gt;&gt;&gt; s = str(&#39;hello&#39;)<br>&gt;&gt;&gt; b = bytes(&#39;hello&#39;,&#39;ASCII&#39;)<br>&gt;&gt;&gt; b<br>b&#39;hello&#39;<br>&gt;&gt;&gt; s<br>&#39;hello&#39;<br>&lt;/console dump&gt;<br><br>I think that the only non-confusing way during transition to Python 3 is to use a user-defined type for bytes of binary data.<br>
<br>Also, we should plan for an optional attribute for either the individual field objects, or perhaps the create_database object, to specify which encoding to use when converting unicode Python strings into 8-bit database fields.<br>
--<br>Vernon <br><br>