Re:Python's missing string type
by HelloNurse on Friday April 18, 2014 @05:46AM
(#7608590)
Do you want to experiment with rope-style data structures containing variable length encodings of characters? Fine, but please don't confuse efficient data structures with correct Unicode handling, which is a major improvement in Python 3 even if you resent it.
Metaphorically speaking, what do you prefer to have: a painful scar or undiagnosed skin cancer? Assumptions about input encodings are the latter.
Ropes might or might not perform better than current array-based str and bytes implementations, but attempting to unify the two data types is just wrong. For example, would you count lengths and offsets in bytes or in characters? You need two data types to get the two possible behaviours.
Re:Python's missing string type
by mborch on Friday April 18, 2014 @05:28PM
(#7611422)
I would count lengths and offsets with respect to characters (codepoints). Note that for fixed-length encodings such as "raw", "ascii", or "latin-1", this always means bytes.
Ropes might or might not perform better than current array-based str and bytes implementations, but attempting to unify the two data types is just wrong. For example, would you count lengths and offsets in bytes or in characters? You need two data types to get the two possible behaviours.