[Python-3000] Thoughts on new I/O library and bytecode
Guido van Rossum
guido at python.org
Wed Feb 21 19:13:34 CET 2007
Sorry, that was an unfortunate typo. bytes are Mutable. (It's the same
as in Java, really.)
On 2/21/07, Jim Jewett <jimjjewett at gmail.com> wrote:
> Are bytes supposed to be mutable?
> > even be changed to *take* a bytes object as the destination buffer
> > This already works -- bytes support the buffer API.
> but later:
> > I think you misunderstood the plans for bytes. The plan is for the
> > performance with bytes to scream, in part because they are immutable
> > so one would occasionally save copying a buffer an extra time.
> Or did you mean that (C code only?) could pass a newly constructed
> bytes object to be filled in?
> Josiah mentioned several dropped methods (append, extend, remove, pop)
> that don't really make sense with an immutable. Was this just a
> set-difference observation, or are those methods you actually need on
> a bytes type?
Even though bytes are mutable sequences, I'm not sure that they need
to support every method that lists have. I expect an in-place +=
operator solves most needs. Slices copy.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000