3 ms·
Python 1 didn't know about Unicode, so characters were bytes and things were simple (for latin1 users). Python 2 bolted on Unicode support, so now you had two
by ptx 8y ago
Python 1 didn't know about Unicode, so characters were bytes and things were simple (for latin1 users).
Python 2 bolted on Unicode support, so now you had two kinds of strings (old-style strings and Unicode strings) with implicit conversions between them (that would blow up spectacularly when you least expected it) and overall a huge mess.
Python 3 removes the old-style strings (replacing them with the "bytes" type and explicit conversions), so that we once again have only one type of string, and once again things are simple. This clean-up unfortunately means that code relying the Python 2 string type confusion will break.
- k__ 8y agoWell, at least someone tried to clean things up. Other languages simply carry these bugs around forever.