[storm] Should storm have separate String and Blob datatypes?

James Henstridge james at jamesh.id.au
Wed Jul 1 14:50:00 BST 2009


On Wed, Jul 1, 2009 at 8:35 PM, Gustavo Niemeyer<gustavo at niemeyer.net> wrote:
>> Given the naming that Python eventually settled on, it might be worth
>> renaming RawStr() to Bytes() to cut down on confusion.
>
> Agreed, we should implement support for Bytes, except I think we
> shouldn't rename RawStr to it, but rather use Bytes exclusively to
> represent the new "bytes" type, offering people the chance of a smooth
> migration (Python 2.6 has both strings and bytes).

Actually, Python 2.6 doesn't have a separate bytes type.  It is just
an alias for the existing byte string type:

    $ python
    Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
    [GCC 4.3.3] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> bytes
    <type 'str'>
    >>> type(bytes('foo'))
    <type 'str'>
    >>> type(b'foo')
    <type 'str'>

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().

For what it is worth, we seem to have another alias for RawStr().  In
storm/properties.py we have:

    # OBSOLETE RawStr was Chars in 0.9. This will die soon.
    Chars = RawStr

We can probably get rid of that one now.

> Out of curiosity, the name of RawStr is also like that to avoid
> confusion with the upcoming naming conventions.  "str" in Python 3.0
> is actually unicode, so it'll be natural to have Str in Storm some day
> to represent it.

Sounds good.

James.



More information about the storm mailing list