4 ms·
The article says this: "Moving from Python 2 to 3 is not an easy task." I disagree with this. It's a Python project's dependencies that make it hard to move fr
by benatkin 7y ago
The article says this: "Moving from Python 2 to 3 is not an easy task."
I disagree with this. It's a Python project's dependencies that make it hard to move from 2 to 3, and most libraries have been updated.
Of course, you could argue that it isn't easy to migrate a codebase from one major version of a language (or framework, or database) to another, but when you eliminate easy from your vocabulary it becomes harder to describe different levels of difficulty.
- foolfoolz 7y agomigrating from python 2 to 3 is such a large task that migrating to any other language is a comparable effort. this is not just a library problem the language itself changed significantly source: no python services at my company are going to be migrated to python 3; it’s all moving to a JVM
- was_boring 7y agoWhat? I've done it on some sufficiently large code bases, and small ones, and it was done way faster then a rewrite. With tools like 2to3 you can assign it to an intern and have it done pretty quickly.
- edoceo 7y agoIt's not quite that easy.
- zo1 7y agoMigrating to 2-3 can be a large task in some very rare cases possibly, but for the most part it is practically effortless if you don't have to support both simultaneously. The biggest hurdle might be the "fear" of the unicode change, but that can be dealt with. Source: All python services at my current workplace are in the process of being migrated to 3.*, and I'm doing one of the main ones at the moment and it's a breeze, including compiled c-extensions. For curiosity, a good list of actual python3 syntax changes: https://docs.python.org/release/3.0.1/whatsnew/3.0.html#overview-of-syntax-changes https://docs.python.org/release/3.0.1/whatsnew/3.0.html#over...
- CivBase 7y ago> migrating from python 2 to 3 is such a large task that migrating to any other language is a comparable effort I'm going to call BS on that one. If you're having issues with Python 2, then it might make more sense to switch to another language instead of upgrade to Python 3. But going from Python 2 to 3 is much easier than switching languages completely. Python is not a perfect language. There is no perfect language. It sounds like your company just had a reason for switching to a JVM language and the Python 2 EOL was a justification to start.
- glofish 7y agoI agree - the statement that migrating from Python 2 to Python 3 is a comparable effort to migrating from Python 2 to Go feels grossly exaggerated.
- tapirl 7y agoAT least, it is more exciting for a developer to migrate from Python 2 to Go than to Python 3. :D
- rlonstein 7y agoI'm skeptical too but if they're doing a lot of communication with other services and they relied on bytes and ASCII just working and the code isn't backed up by tests then I can see them having a very bad time going from Py2 to Py3.
- gunnihinn 7y agoN=1 and all that, but I ported 500k lines of a Python 2 monorepo to Python 3 this year and it took like two weeks, including a week spent reading Eevee’s post on the subject half a dozen times and playing with six and futurize.
- seriesf 7y agoNumerous large projects and companies have publicly stated that they are stuck on Python 2 and it's easier to migrate languages, even to ones that they have to invent (Go) than to migrate to python 3. At least one of these companies had Guido on their staffs for years. Another, also with Guido on the staff, needed over three years to migrate from 2 to 3. The overwhelming body of evidence shows that migrating a large project from 2 to 3 borders on impossible, but there's always someone willing to pop up on HN to say how easy it is.
- glofish 7y agowait - what? Is Django a big enough project for you? Did you know that Django was not only successfully migrated from Python 2 to Python 3, it was ported in such a way that for many years it used the same codebase in both languages ... Perhaps that's the biggest advantage of porting from 2 to 3. A lot of the code could run in both languages.
- seriesf 7y agoThe corollary of my complaint is there will always be someone who pops up on HN with no idea how many lines of code are in a "large project" like Dropbox or YouTube.
- glofish 7y agoThis is kind of a cop-out, how would anyone know? Is Dropbox open source? Is Dropbox even a typical Python application representative of the challenges of porting from 2 to 3? My hunch is that the challenges of porting Dropbox to any other language have to do less with Python more with the need to deal with a filesystem at a lower and more granular level than what typical programming languages offer. Thus everything needs to be rewritten in bazillions of ways to handle the bazillion corner cases.
- joshuamorton 7y agoWhich companies are those? Because neither Google nor Dropbox have claimed the things you're implying they did.
- pbreit 7y agoThat’s precisely why it’s not an easy task!!