Re:Mercurial’s journey to and reflections on Python 3
by takeda on Tuesday January 14, 2020 @12:42PM
(#22047137)
This is called a leaky abstraction. I can't find a good behavior for a high level language to do it this way. If you use index in a string you always will get something that's invalid, at least in Python or Java you get code points.
This is not an implementation detail, it is fundamental to how the str type in Python 3 operates. I have not talked at any point about the internal storage of this type, just the interface it publicly exposes.