Glyphs and graphemes [was Re: Cult-like behaviour]

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Jul 17 03:56:39 EDT 2018


On Tue, 17 Jul 2018 09:52:13 +0300, Marko Rauhamaa wrote:

> Both Python2 and Python3 provide two forms of string, one containing
> 8-bit integers and another one containing 21-bit integers.

Why do you insist on making counter-factual statements as facts? Don't 
you have a Python REPL you can try these outrageous claims out before 
making them?

py> b'abcd'[2] + 1  # bytes are sequences of integers
100

py> 'abcd'[2] + 1  # strings are not sequences of integers
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Can't convert 'int' object to str implicitly


Python strings are sequences of abstract characters.



-- 
Steven D'Aprano
"Ever since I learned about confirmation bias, I've been seeing
it everywhere." -- Jon Ronson




More information about the Python-list mailing list