[Python-3000] Immutable bytes -- looking for volunteer
Guido van Rossum
guido at python.org
Wed Sep 19 20:24:47 CEST 2007
I think ord() would be fine.
On 9/19/07, Brett Cannon <brett at python.org> wrote:
> On 9/17/07, Guido van Rossum <guido at python.org> wrote:
> > This may have passed in a thread where no-one was listening, so I'm
> > repeating it here.
> >
> > I'm considering the following option: bytes would always be immutable,
> > and for the few places (mostly in io.py) where a mutable bytes buffer
> > would be handy, we use the array module. Then it would also make sense
> > to make b[0] return a bytes array of length 1 instead of a small int
> > -- bytes would be more similar to str in 2.x, albeit completely
> > incompatible with str in terms of mixed operations.
> >
>
> How far do you want to push the similarity? For instance, would ord()
> start working on length 1 byte arrays or would int() be the only way
> to get the integer out of the byte?
>
> -Brett
>
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000
mailing list