Mutable Bytes
Martin Christensen <[email protected]> Sat, 24 Jul 2004 09:36:06 +0200
| Newsgroups | gmane.comp.lang.prothon.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0223769705== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= 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 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iEYEABECAAYFAkECEWoACgkQYu1fMmOQldXH3gCghpBLrMKxEmETC2euYh9iG1V/ e1EAoL5h15ptZX8+hUZMDCQxuV0vs+4j =Rs2D -----END PGP SIGNATURE----- --=-=-=-- --===============0223769705== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline