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

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


M.-A. Lemburg wrote:
> Anyway, this whole discussion about a new bytes type doesn't
> really solve the problem that the b'...' literal was
> intended for: that of having a nice way to define (read-only)
> 8-bit binary string literals.

But why do you need a way to spell 8-bit string literals?
You can always do

    "string".encode("L1")

If that is too much typing, do

    def b(s):return s.encode("L1")

    b("string")

Regards,
Martin


More information about the Python-Dev mailing list