[Python-Dev] Re: adding a bytes sequence type to Python (original) (raw)

Michael Hudson mwh at python.net
Tue Aug 17 14:49:21 CEST 2004


Anthony Baxter <anthony at interlink.com.au> writes:

Guido van Rossum wrote:

I see that as a huge case for a bytes type, which I've proposed myself; but what's the use case for bytes literals, assuming you can write bytes("foo")? Does b"foo" really make much of a difference? Is it so hard to have to write bytes([0x66, 0x6f, 0x6f]) instead of b"\x66\x6f\x6f"? It's a pretty marginal case for it. I just played with it a bit, and I think after playing with it, I actually prefer the non b'' case.

Is this getting to (hopefully uncontroverisal!) PEP time?

Is there any consensus forming on whether bytes() instances are mutable or not?

A big +1 for a bytes() type, though. I'm not sure on the details, but it'd be nice if it was possible to pass a bytes() object to, for instance, write() directly.

If bytes() doesn't implement the read buffer interface, someone somewhere is going to need shooting :-)

Cheers, mwh

-- rasterman is the millionth monkey -- from Twisted.Quotes



More information about the Python-Dev mailing list