3 ms·
Python 2-3 is a great COUNTER example of what I'm saying. There was no intermediate release that could run both python2 and python3 code. It introduced new fe
by WhyNotHugo 5y ago
Python 2-3 is a great COUNTER example of what I'm saying.
There was no intermediate release that could run both python2 and python3 code.
It introduced new features AND removed the old ones all at once.
- MaxBarraclough 5y ago> There was no intermediate release that could run both python2 and python3 code. Right, but would that have helped? Transitioning a large codebase from Python2 to Python3 is a significant undertaking, there's no way around it. As I understand it there are dedicated tools to help migrate Python code, but it's still no small thing if you're dealing with a large codebase. Perhaps it would have been helpful to have an interpreter that supported the union of both languages, but I don't see that this would have changed things from significantly costly down to no big deal. It would make the process more incremental, but it would still represent significant work. There are legitimate reasons people don't want to have to modify large stable codebases. (To be clear, I haven't had to do this personally, but that seems to be the sentiment of people who have.) C++, on the other hand, goes to considerable lengths to preserve backward compatibility, at the cost of accumulating complexity.
- kevincox 5y agoIt would have helped immensely. The main issues with the upgrade is that: 1. Libraries needed to maintain both versions (or code compatible with both. 2. Projects couldn't upgrade until their dependencies did. If Python 3 could run old code (for example you needed to write `import py3` at the top of a file to switch) then all projects could have updated their code in parallel, there would be no (or minimal) work to maintain support for old versions and everyone can update to py3 the day it came out. The workflow then looks like this: 1. Everyone updates to Py2.9 which supports the old features and the new features. 2. Everyone migrates their code to use the new features and remove deprecated features independently. 3. Py3 comes out and drops support for the old stuff. 1 is not trivial, but it is equivalent to any other time that you drop support for old versions, this happens regularly and isn't a huge event. Compare that to the nasty wave of updating dependencies and requirement to continue supporting old versions, especially since the code to support multiple versions was fairly awkward for a lot of projects.
- jeltz 5y agoIt helped for Ruby. Ruby released 1.8.6 and 1.9.1 which were both two intermediate steps between Ruby 1.8 and 2.0. 1.8.6 beibg similar to 1.8.4 but with many added 2.0 features and 1.9.1 which was almost 2.0 but with some deprecated features in it. I got to experience both and the Ruby 2 migration was much smoother than the Python 3 one. EDIT: To be clear, Ruby did not make it literally possible to run both 1.8 and 2.0 in the same code base but with just a few conditional statements and avoiding to use non-backported 2.0 features it was easy to write libraries which could run in both 1.8.6 and 1.9.
- gwoplock 5y ago> Right, but would that have helped? Transitioning a large codebase from Python2 to Python3 is a significant undertaking, there's no way around it. I haven't migrated from python2->3 however I've worked on projects in both. I think a "python2+3" version would have helped. With both APIs in place new code can be written the new way and old code can be migrated as it is touched. Having the ability to incrementally change code I think encourages the transition since you won't end up with a pile of broken code.
- PeterisP 5y agoYou could transform your 2.x code so that it would run on both 3.x python and also on recent 2.x python versions, using new features with appropriate `from __future__ import` statements; so in that regard the latest 2.x versions were those intermediate releases that could also run 'new style' code. I had a bunch of internal code that would run on both 2.x and 3.x python, and many libraries also did just that.
- jnxx 5y agoSo why does the Python Wiki runs Python 2 with MoinMoin Wiki? You seem to imply it is easy and quick to rewrite software to match it to new versions, and resources for this are always available?