Unicode and Python - how often do you index strings?

wxjmfauth at gmail.com wxjmfauth at gmail.com
Wed Jun 4 02:50:37 EDT 2014


Le mercredi 4 juin 2014 02:39:54 UTC+2, Chris Angelico a écrit :
> A current discussion regarding Python's Unicode support centres (or
> 
> centers, depending on how close you are to the cent[er]{2} of the
> 
> universe) around one critical question: Is string indexing common?
> 
> 
> 
> Python strings can be indexed with integers to produce characters
> 
> (strings of length 1). They can also be iterated over from beginning
> 
> to end. Lots of operations can be built on either one of those two
> 
> primitives; the question is, how much can NOT be implemented
> 
> efficiently over iteration, and MUST use indexing? Theories are great,
> 
> but solid use-cases are better - ideally, examples from actual
> 
> production code (actual code optional).
> 
> 
> 
> I know the collective experience of python-list can't fail to bring up
> 
> a few solid examples here :)
> 
> 
> 
> Thanks in advance, all!!
> 
> 
> 
> ChrisA

=============

Like many, you are not understanding unicode because
you do not understand the coding of characters.

You do not understand the coding of the characters
because you do not understand the mathematics behind it.

You focussed on the wrong problem.

(All this stuff has been discussed, tested and worked on
>20 (twenty) years ago.)

Sorry.

jmf




More information about the Python-list mailing list