[Python-Dev] Re: adding a bytes sequence type to Python

Guido van Rossum guido at python.org
Tue Aug 17 12:45:26 CEST 2004


> Guido van Rossum wrote:
> > (I'm still not sold on the concept of bytes literals at all.)

[Anthony]
> Ok. Here's a case - in shtoom, I generate audio data. Lots
> of audio data. This is broken into packets, then gets a small
> header put onto each RTP packet. Right now, I'm using strings
> for this. If there was a 'byte literal', I'd use it. This isn't
> a huge problem right now, because strings are good enough. But
> if we end up in an 'all the strings are unicode', I'll need
> _some_ way to construct these packets.

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"?

IOW, how many *literal* packet fragments are in shtoom?

--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list