5 ms·
The syntax changes introduced in python 3 are easy to fix, and most of them are backwards compatible with python 2.7. The whole string/byte dichotomy, however,
by herge 11y ago
The syntax changes introduced in python 3 are easy to fix, and most of them are backwards compatible with python 2.7.
The whole string/byte dichotomy, however, is a major change that I don't think any shim layer could handle correctly without major bugs, short of defining a whole new string-like class.
- frik 11y agoThe shim layer would have to convert all strings from v2 representation every time to the v4 implementation. Slower, but at least v2 could run unchanged. As we all know certain code won't be touched for whatever reason. It could certainly prevent some from deciding to move off to other languages like Go, Elixir, Node.
- herge 11y agoYour shim layer would have to make assumptions on the encoding of your strings, which can lead to nasty bugs. And also handle reading from files correctly, or list file names from the os, or anything that communicates outside of the python interpreter. The main reason why python 3 was created was to manage these complexities, and even then some people[1] say it wasn't done properly. [1] http://lucumr.pocoo.org/2014/5/12/everything-about-unicode/ http://lucumr.pocoo.org/2014/5/12/everything-about-unicode/