3 ms·
Python strings are immutable. The only time a string can get its first non-Latin-1 character is at construction time, which is necessarily O(n).
by jwilk 9y ago
Python strings are immutable. The only time a string can get its first non-Latin-1 character is at construction time, which is necessarily O(n).