|
|
|
|
|
by Izkata
960 days ago
|
|
Don't forget string literals: Python 2 had b'byte string' and u'unicode string' with unmarked being 'byte string' Python 3.0 had b'byte string' and unmarked being 'unicode string' Because python 2 was so lenient with mix'n'matching the two string types, it wouldn't error if you only were using ASCII values and finding all these places where strings weren't quite right can get pretty difficult. It also meant libraries had to awkwardly always use b'byte string'.decode('utf8') if they wanted to create a unicode string and be compatible with both python 2 and 3. Python 3.3 then reintroduced prefixed u'unicode strings' to make it significantly easier for libraries, simply by always using b'' and u'' instead of ever using ''. It also made any preexisting unicode-aware code "just work" without having to be converted from u'' to ''. I think I remember hearing about other similar compatibility changes made in either 3.4 or 3.5, but can't remember what they would have been. |
|