On 25/11/10 06:37, Alexander Belopolsky wrote: > I don't think there is a recipe on how to fix legacy > character-by-character processing loop such as > > for c in string: > ... > > to make it iterate over code points consistently in wide and narrow > builds. A couple of possibilities: 1) Make things so that 'for c in string' does actually iterate over characters rather than code units. This could break existing code, though. 2) Provide some things like for c in string.chars(): ... for c in string.graphemes(): ... where chars() and graphemes() return appropriate iterators. (Or possibly iterable views, but that would raise the expectation that the views could also be randomly indexed by char or grapheme, which we probably wouldn't want to support.) -- Greg
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