3 ms·
Do you want to experiment with rope-style data structures containing variable length encodings of characters? Fine, but please don't confuse efficient data stru
by HelloNurse 13y ago
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.
- mborch 13y agoI 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.