<div class="gmail_quote">On Wed, Jul 1, 2009 at 9:48 AM, James Henstridge <span dir="ltr"><<a href="mailto:james@jamesh.id.au">james@jamesh.id.au</a>></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<<a href="mailto:gustavo@niemeyer.net">gustavo@niemeyer.net</a>> wrote:<br>
>> Actually, Python 2.6 doesn't have a separate bytes type. It is just<br>
>> an alias for the existing byte string type:<br>
><br>
[...]</div>I know that there were behaviour changes. What I'm getting at is that<br>
there are no versions of Python that have both a "str" and "bytes"<br>
type<br>
<div class="im"></div></blockquote><div> </div></div>James:<br>
I don't think what you said what you meant... <br>
See the following...<br><br><console dump><br>C:\Users\vernon>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 "help", "copyright", "credits" or "license" for more information.<br>
>>> s = str('hello')<br>>>> b = bytes('hello','ASCII')<br>>>> b<br>b'hello'<br>>>> s<br>'hello'<br></console dump><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>