On Wed, Jul 1, 2009 at 9:48 AM, James Henstridge <[email protected]> wrote:
> On Wed, Jul 1, 2009 at 10:44 PM, Gustavo Niemeyer<[email protected]> > wrote: > >> Actually, Python 2.6 doesn't have a separate bytes type. It is just > >> an alias for the existing byte string type: > > > [...] > I know that there were behaviour changes. What I'm getting at is that > there are no versions of Python that have both a "str" and "bytes" > type > James: I don't think what you said what you meant... See the following... <console dump> C:\Users\vernon>c:\python31\python.exe Python 3.1 (r31:73574, Jun 26 2009, 20:21:35) [MSC v.1500 32 bit (Intel)] on wi32 Type "help", "copyright", "credits" or "license" for more information. >>> s = str('hello') >>> b = bytes('hello','ASCII') >>> b b'hello' >>> s 'hello' </console dump> 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. 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. -- Vernon
-- storm mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/storm
