python 2.7 and unicode (one more time)

Marko Rauhamaa marko at pacujo.net
Tue Nov 25 07:23:31 CET 2014


Steven D'Aprano <steve+comp.lang.python at pearwood.info>:

> Marko Rauhamaa wrote:
>
>>> Py3's byte strings are still strings, though.
>> 
>> Hm. I don't think so. In a plain English sense, maybe, but that kind of
>> usage can lead to confusion.
>
> Only if you are determined to confuse yourself.
>
> {...]
>
> In Python usage, "string" always refers to the `str` type, unless
> prefixed with "byte", in which case it refers to the immutable
> byte-string type (`str` in Python 2, `bytes` in Python 3.)

You are saying what I'm saying.

Byte strings are *not* strings.

Prairie dogs are not dogs. No need to call dogs "domesticated dogs" to
tell them apart from "prairie dogs".


Marko





More information about the Python-list mailing list