[storm] Should storm have separate String and Blob datatypes?
James Henstridge
james at jamesh.id.au
Wed Jul 1 16:48:04 BST 2009
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:
>
> Ouch.. from the discussions during development I understood that it'd
> actually be the real bytes type.
>
>> This is pretty close to Python 3 where stringobject.c was renamed
>> bytesobject.c: they have never existed in parallel. So I don't think
>> we want separate Bytes() and RawStr().
>
> It wasn't just renamed it's a very differently behaving type:
>
>>>> bytes(b"foo")[0]
> 102
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
> So I still think we should make Bytes support the real bytes type, and
> keep RawStr on the old str. This will likely yield startup
> exceptions rather than late runtime ones, and will help people
> upgrading it smoothly.
I'm not sure how that would work. The only versions of Python with a
dedicated "bytes" type are 3.x releases, which we won't be able to
support from the same code base as the one for Python 2.x.
The upgrade path in 2.6 is to treat "str" as the "bytes" type, so
having a Bytes() property that represents values as 8-bit strings
would be consistent. And if we are using 8-bit strings as values,
then RawStr() is that implementation.
James.
More information about the storm
mailing list