4 ms·
Which "solution" was that? Your comment suggesting that len() should be the length in bytes of a UTF-8 representation of the string? That would be a terrible t
by ubernostrum 9y ago
Which "solution" was that? Your comment suggesting that len() should be the length in bytes of a UTF-8 representation of the string?
That would be a terrible thing for people who work with strings as strings, and would essentially tell such people -- who make up a lot of Python's user base! -- "go use something else, this language is only for sysadmins to write Unix utilities now".
- mjevans 9y agoNo, the one that re-unifies the sequences of bytes that might be "strings" under one container object which has fields indicating what kind of format it is and automatic coercion methods for common types.
- ubernostrum 9y agoPretending that strings and sequences of bytes are identical and interchangeable is fundamentally flawed. The only reason people were able to get away with it for as long as they did was because of immense pain inflicted on the rest of the Python programming community. If you require an eternally frozen implementation of Python 2's behavior in order to get your work done, you can download the source and keep it around as long as you like. Nobody else has an obligation to support you or hold back the rest of the world in order to suit your use case in your preferred way.