3 ms·
> Because whenever a Unicode and a non-Unicode string had to be combined, it used ASCII as the default encoding to converge them. They could have just changed
by otabdeveloper4 7y ago
> Because whenever a Unicode and a non-Unicode string had to be combined, it used ASCII as the default encoding to converge them.
They could have just changed the default encoding to utf8. (For those too lazy to configure their Python properly.)
There, problem solved - and no need for a breaking Python 3.
- int_19h 7y agoIt would still be a mess any time you have to deal with byte strings that aren't UTF-8. The problem is with the implicit conversion itself - it shouldn't happen, because there's no way to properly guess the encoding. But there was no way to get rid of it without breaking things.
- otabdeveloper4 7y ago> But there was no way to get rid of it without breaking things. Even such a breaking change would be a molehill compared to the mountain of breaking changes in Python 3. Point is, they had one job, and they failed.
- int_19h 7y agoThat change was at the heart of the breaking changes around strings in Python 3. If the conversions remained implicit, most people would probably have never even noticed that string literals default to Unicode, or that some library functions now require Unicode strings.