5 ms·
What is really needed is a 3to2. I have been very impressed with 2to3, the amount of work it does is pretty impressive. But as somebody who tends and prefers t
by dorfsmay 13y ago
What is really needed is a 3to2.
I have been very impressed with 2to3, the amount of work it does is pretty impressive. But as somebody who tends and prefers to work in python 3 but often needs my scripts to run in python 2, I have no choice but write those in python 2. I can see the same dilemma for somebody who writes an open source library and hope for as much usage as possible.
- toyg 13y agoNo, I actually agree with a commenter on the page: what you need is a small compatibility layer to run 2.x code on 3.x, which can be slow and emit loads of warnings, and then stop making 2.x available AT ALL. What 3to2 and six really do is keeping the 2.x runtime alive, and as long as the runtime sticks around (and is patched, and features are backported etc etc etc), people will keep using it.
- JulianWasTaken 13y agoThat wouldn't solve the main issue, which is the [non-negative] amount of work in porting existing Py2 codebases. Besides, 3to2 (which does exist but isn't maintained) and 2to3 are both bad ideas. They miss edge cases, even common ones, and they add even more complexity to the build/test/install process which people already find hard.
- dorfsmay 13y agoSure 2to3 misses a lot of edge cases, but it does make porting from 2 to 3 A LOT faster, doing all the basic stuff for you.
- dguo 13y ago3to2: https://wiki.python.org/moin/3to2 https://wiki.python.org/moin/3to2