Mutable Bytes
"Mark Hahn" <[email protected]> Sat, 24 Jul 2004 14:52:27 -0700
| Newsgroups | gmane.comp.lang.prothon.user |
|---|---|
| Message-ID | <[email protected]> |
<moved from prothon-dev> Martin Christensen <[email protected]> wrote: Howdy! I've been implementing a bitmap index in Python, where I'm using regular strings to store the bitmap. Considering all the time that's spent in ord() and chr(), I'm sure you can imagine that I'll be quite glad of Prothon's Bytes when it comes to porting it. :-) However, one thing irks me: when Bytes is meant for raw data manipulation, why is it immutable? I don't imagine it being an overly likely candidate for dictionary keys and such, though of course you never know. I just find it rather surprising that with a data type like this, I still have to resort to something as inefficient as data = data[:i] + newbyte + data[i+1:] just to change a single byte. Or did I miss something? So my request is to make the Bytes type mutable unless there's some other good reason not to do so. Martin -- Homepage: http://www.cs.auc.dk/~factotum/ GPG public key: http://www.cs.auc.dk/~factotum/gpgkey.txt