[storm] Should storm have separate String and Blob datatypes?
Vernon Cole
vernondcole at gmail.com
Wed Jul 1 20:12:51 BST 2009
On Wed, Jul 1, 2009 at 9:48 AM, James Henstridge <james at jamesh.id.au> wrote:
> On Wed, Jul 1, 2009 at 10:44 PM, Gustavo Niemeyer<gustavo at niemeyer.net>
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20090701/336e81e8/attachment.htm
More information about the storm
mailing list