3 ms·
So, the problem is that the Python developers - in my opinion unneccessarily - broke backwards compatibility. There are two main problems - the print function,
by captainmuon 10y ago
So, the problem is that the Python developers - in my opinion unneccessarily - broke backwards compatibility. There are two main problems - the print function, and str/unicode. They could just add two or three things, and I'd be completely satisfied. I hope they are self-descriptive:
from __past__ import print_statement
import unicode_string as str, bytestring as bytes
import unicode_string as unicode, bytestring as str
from python2 import legacy_module
... or equivalent comment options (a la "coding: utf8"), or iterpreter flags, or something like that. Perl 6 manages to load Perl 5, I don't see why this shouldn't be possible in Python.
Now you might say this is petty, why get worked up by something as minor as the print statement. But just because it is so minor, it feels so unneccessary and petty to remove it.
The str/unicode switch was also not handled optimally. There is a lot of code still broken. I just ported some code to Python 3 which uses Twisted, and found the FTP implementation does not work in Python3. It turns out this is really hard to fix, because FTP is not encoding aware, and bytestrings "I dont care right now what encoding this is"-strings are second class citizens in Python3.
It's a bit unfortunate that the Python developers get to decide what is defined as Python and what not. When something gets big, I believe you get certain responsibilites. You shouldn't just "break the world" and strand lots of developers in 2008. That they even published a PEP stating there will be no Python 2.8 is silly and mean.
To end on a hopeful note: Why won't someone make a Kickstarter... if you manage to get full support for loading Python 2 modules into the current, main CPython 3 codebase (upstream), I'd be willing to pay, say, 100€. I'm sure some companies with legacy codebases would like to chip in.
- true_religion 10y agoWhat is a major open source project that is Python 2 only?
- mwpmaybe 10y agoAnsible.
- captainmuon 10y agoParts of Twisted. But open source projects are not the problem. We (a major scientific collaboration) have likely millions of lines of Python (2). Mostly used in one-off plotting scripts, or as configuration or steering files. On the one hand, I bet >95% of these scripts translate perfectly with 2to3.py, have no unicode/str confusion issues, and would be trivial to port. It's often really just the "print". On the other hand, most of this is "legacy" code, and there is no benefit to port it - we'd rather not mess with code that is supposed to be "frozen" and e.g. able to reproduce past scientific results, and nobody will spend time porting it without tangible benefits. Last I checked, it was considered "too hard" to move to Python3, but in the meantime we are switching VCS (from SVN(!) to git), we are rewriting our main framework to be multithread-capable, and tackling a bunch of other gargantuan tasks. So if going to Python3 is harder than all that, then I think something went wrong with the transition. (For the record, for personal projects I use Python3 now, as everything has catched up for me.)