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

"Martin v. Löwis" martin at v.loewis.de
Wed Aug 18 07:09:18 CEST 2004


Skip Montanaro wrote:
> My understanding is that bytes
> objects are just that, raw sequences of bytes in the range 0x00 to 0xff,
> inclusive, with no interpretation of any type.

Yes, but your understanding is limited :-) This idea is good, but it
falls short once we talk about source code, because source code does
have an encoding. So if you don't want to incorporate the notion of
encodings into the byte string types, yet be able to declare them
in source code, you have to go for a numeric representation. I.e.
you write
    bytes(71,69, 84)
instead of
    b"GET"

As soon as you use some kind of string notation for denoting byte
code values, you immediately *have* to deal with encodings.

Regards,
Martin


More information about the Python-Dev mailing list