Hacker News new | ask | show | jobs
by atoav 2100 days ago
Python 2 is EOL, which means the language (and worse: probably all non-standard dependencies you are using) are stuck in time unless everybody decides to go with Python 2 and ditch Python 3.

This would mean considerable dev time to track bugs in the language and dependencies that have been fixed by others in their Python 3 variants. And that means a dev that could have worked on new features now works to do (silly) maintenance work. This clearly does have an impact in the long run.

I am working with Python myself. Everything I moves to Python 3 was a one-time effort, while the stuff where I had stayed with Python 2 means constant effort of making sure it is still safe and no major bug has been discovered in the deps.

I understand the annoyance people have with this, but there aren't to much rational arguments why to use Python 2 over Python 3. In fact it would be the other way around. Before it was minor differences, but the language evolved in a good way since ca. version 3.5 and some of the solutions are really useful (typing, dealing with encodings and unicode, not having to make sure you are using floats when dividing two numbers etc.)

In practise by far the biggest difference is that print foo becomes print(foo), and that is not a big deal if you ask me

4 comments

Please understand how big codebase is. Porting pyqt stuff is not easy. If you see comments in bug, author and others already started to work on port, but they knew it will take time and they were sure of easyness of maintaining old version. It is always easy to whine than UNDERSTANDING and DOING actual work. As you're already developer, you must know that if it is that easy, author had it ported already

Plus as port itself doesn't affect any user experience, it was not emergency situation. It is just that 'we are working FREELY with our own pace, so it will take time. Actual contribution is really appriciated than complains'

There is another similar program I miss is, leafpad. It is dropped by distros as not yet ported.

I do understand that, my point was precisely that this is always a tradeoff between multiple things. If maintaining the old version is easier than migrating to the new one, you don't do it.

This balance — however — can change with time. E.g. if one of your major dependency moves to Python 3? Or gets abandoned.

I didn't say it was easy, my point was that over time more and more dependencies make a shift to Python 3 as well, which means at some point Python 2 stuff becomes harder to maintain. Whether that point happens early or late depends entirely on the project.

Additionally I nowhere said that this must be done by anyone — you are projecting here.

For me the biggest issue was the reuse of datatype identifiers for different datatypes. Python 2 had a byte string <str> and a unicode string <unicode> types. Python 3 still has both types, but now the byte string type is called <bytes> and the unicode string type is called <str>.

The new names are without a doubt better. In a vacuum. But coming from Python 2 to Python 3 and dealing heavily with encodings because I use Python for massaging machine-generated reports, the fact that they reused the same datatype identifier for bytes in P2 as for unicode in P3 really put me off.

Now that I've made the change (OK, six years ago) I'm much happier with the way Python 3 handles bytes and unicode strings. I think it is a model that all languages could learn from. But it should have been called <string> or stayed <unicode> instead!

Yeah, indeed many things about that transition could have been handled better. E.g. it should have been more small incremental steps, the version 2 should have been phased out quicker, there should have been tooling to help transitions like these etc.
Python2 is old and has been in widespread use for years. Realistically, how likely is it that a new bug will be found that affects Calibre.
As far as I know Python 2 wasn’t EOL at the time of the statement from the author of Calibre.

So it’s kind of harsh to judge that statement in that light isn’t it?

Actually, it was. The last version of Python2 was 2010 released, with only bugfix-versions coming after this. And EOL for those bugfix-versions was also set at the time of the statement, and actually even twice, as the date was pushed back by some years.

Everyone at that time knew that Python2 is dead and that everything is in transition to python3. Most new code was written for python3 and not even compatible for python2 anymore. So it really was just one guy deciding to maintain his own fort on his own.