I still think that it was a huge mistake from Python not to just bite the bullet and create some kind of Python 2-3 interpreter like a decade ago when it became obvious there was just too much momentum against moving to 3.
Basically something that'd let you mark it and all of its dependencies as 2.7, do some fairly thorough translation that gets 99.8% of the existing code and ideally warning about things it felt it couldn't translate. Some performance loss would be acceptable. A flag could be given to print warnings for anything that wasn't 3.
It didn't have to be perfect, it just had to allow a company to start writing new stuff in 3 only having to modify a few things without having to touch their entire code base. They could then also start incrementally porting things to Python 3 without having to make sure they do everything and their external dependencies at once.
It isn't ideal, but I really, really feel like despite Python's progress over the last decade, it would have been significantly more if all the effort was on Python 3 and all the new features of Python 3 were available to the majority of the Python users. I wonder how many companies switched from Python 2 to golang or similar for features or performance that would have been acceptable in Python 3?
I very much agree. A from __future__ import py3hosting or something, to restore python2.7 semantics for the things that were incompatibly changed. That plus from __future__ import print_functionwould have handled a lot of cases.
56
u/captain_cashew May 30 '19
My company is moving from 2.6 to 2.7! Yay!