73
Python developers won’t let go of Python 2
(www.infoworld.com)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
Python 2 had one mostly-working
str
class, and a mostly-brokenunicode
class.Python 3, for some reason, got rid of the one that mostly worked, leaving no replacement. The closest you can get is to spam
surrogateescape
everywhere, which is both incorrect and has significant performance cost - and that still leaves several APIs unavailable.Simply removing
str
indexing would've fixed the common user mistake if that was really desirable. It's not likeunicode
indexing is meaningful either, and now large amounts of historical data can no longer be accessed from Python.Thanks for that context. Seems odd that they would remove the
str
instead of taking the time to fix it.It's because
unicode
was really broken, and a lot of the obvious breakage was when people mixed the two. So they did fix some of the obvious breakage, but they left a lot of the subtle breakage (in addition to breaking a lot of existing correct code, and introducing a completely nonsensicalbytes
class).