4 ms·
This is how Python 2 did it, only with the difference that you didn't need the b prefix for ascii/byte strings. The problem was that this made a muddle of all
by mumblemumble 4y ago
This is how Python 2 did it, only with the difference that you didn't need the b prefix for ascii/byte strings.
The problem was that this made a muddle of all the string handling functions, which needed to be prepared to handle both types. Including ones you write yourself. And, Python being a dynamic language, getting this right was fiddly and error prone. "Forbid mixing the two" was a workable, if ergonomically annoying, in statically typed languages that predated and then subsequently had to adopt Unicode. For Python, though, it was an enormous minefield of runtime errors.
- tyingq 4y agoAnd you also had to detect which version of Python2, since Python <= 2.5.x didn't have some of the unicode support that later versions did.