Micro Python -- a lean and efficient implementation of Python 3

Marko Rauhamaa marko at pacujo.net
Wed Jun 4 07:57:36 EDT 2014


Tim Chase <python.list at tim.thechases.com>:

> On 2014-06-04 00:58, Paul Rubin wrote:
>> I've never understood why not use UTF-8 for everything.
>
> If you use UTF-8 for everything, then you end up in a world where
> string-indexing (see ChrisA's other side thread on this topic) is no
> longer an O(1) operation, but an O(N) operation.

Most string operations are O(N) anyway. Besides, you could try and be
smart and keep a recent index cached so simple for loops would be O(N)
instead of O(N**2). So the idea of keeping strings internally in UTF-8
might not be all that bad.


Marko



More information about the Python-list mailing list