On Fri, May 28, 2021 at 4:04 AM Peter J. Holzer <hjp-pyt...@hjp.at> wrote: > > On 2021-05-26 08:34:28 +1000, Chris Angelico wrote: > > Yes, any given string has a single width, which makes indexing fast. > > The memory cost you're describing can happen, but apart from a BOM > > widening an otherwise-ASCII string to 16-bit, there aren't many cases > > where you'll get a single wide character in a narrow string. > > A single emoji in a long English text. > > > Usually, if there are any wide characters, there'll be a good number > > of them > > Oh, right. People who use emoji usually use a lot of them 😉. > >
Exactly :) I can easily imagine a short block of text with just one (say, a single email), but if you have a gigabyte or even a couple hundred meg of text, the chances of *a single* emoji become vanishingly slim. ChrisA -- https://mail.python.org/mailman/listinfo/python-list