A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-September/048905.html below:

Re: Alternative Implementation for PEP292:SimpleString Substitutions

[Python-Dev] Re: Re: Alternative Implementation for PEP292:SimpleString Substitutions [Python-Dev] Re: Re: Alternative Implementation for PEP292:SimpleString SubstitutionsNeil Hodgson nhodgson at bigpond.net.au
Tue Sep 14 23:41:45 CEST 2004
James Y Knight:

> It would also be possible to use UTF-8 string storage, although this
> has the tradeoff that indexing an element takes linear time w.r.t.
> position instead of constant time.

   At the cost of additional storage, indexing into UTF-8 by character
rather than byte can be made better than linear. Two techniques are (1)
maintain a list containing the byte index of some character index values
(such as each line start) then use linear access from the closest known
index and (2) to cache the most recent access due to the likelihood that the
next access will be close.

   While I have thought about this problem, it has only once came up
seriously for Scintilla (an editing component) and that was when someone was
trying to provide a UCS2 facade that matched existing interfaces.

   Neil

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4