[I18n-sig] Binary data b"strings" (Pre-PEP: Proposed Python Character Model)

M.-A. Lemburg mal@lemburg.com
Thu, 08 Feb 2001 17:54:27 +0100

Toby Dickenson wrote:
> > OTOH, these b""-strings should implement the same methods as the
> > array type and probably seemlessly interact with it too. I don't
> > know which type should be considered "better" in coercion
> > though, b""-strings or arrays (I guess b""-strings).
> That raises the question of mutability... instances of the array type are
> mutable. On every occasion that I have needed a mutable string type, it has
> been when the string was holding binary data.
> Do we want b"strings" to be mutable?

No way -- that would confuse the hell out of newbies and everyone
else ;-)

I basically want to reuse the string and/or buffer implementation
and add some more useful methods to it, eg. things from the struct
module and array module.
> Do we want b"strings" to be the same as the array type? (if not now, maybe
> at the same time we unify plain "strings" and u"strings")

Not really. Arrays should still be the right type for mutable
binary data chunks, even at that point.

(This idea clearly needs some more thought... :)

Marc-Andre Lemburg
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/