by o11c · 1y ago · 0 comments
With `bytes` it was obvious that byte length was not the same as $whatever length, and that was really the only semi-common bug (and was mostly limited to English speakers who are new to programming). All other bugs come from blindly trusting `unicode` whose bugs are far more subtle and numerous.
Python 3 introduced the bytes type that you like so much. It sounds like you would enjoy a Python 4 with only a bytes type and no string type, and presumably with a strong convention to only use UTF-8 or with required encoding arguments everywhere.
In both Python 2 and Python 3, you still have to learn how to handle grapheme clusters carefully.
https://docs.python.org/3/library/stdtypes.html#binary-seque...
"The core built-in types for manipulating binary data are bytes and bytearray."
Additionally, python2 supported a much richer set of operations on its bytes type than python3 does.