by traes · 6y ago · 0 comments
Python broke compat once in 25 years and gave 13 years to migrate.
It's a very conservative language.
I argued on the list that these should be kept for major releases for planning reasons but they appear to be convinced it is too hard.
I know some Python Libraries break backwards compatibility (Pandas being a big one) - but, for the most part, hasn't the language been backwards compatible since at least Python 3.4? (And possibly further back, for all I know).
It might seem like a quibble, but it seems better to describe Python 3 as a different language versus Python 2. Newbies seem to get that.
(Or, alternatively, "How many Python 2 scripts will run on a Python 3 interpreter?" Answer: "None of them.")
And there are really few that are even near Python popularity, or used with such diversity as Python.
I mean, you can get away with keeping AWK the way it was 2 decades ago, nobody is going to use it for for machine learning or to teach computing in all universities in the world on 3 operating systems, utilizing C extensions, or processing Web API.
Among the few that would even compare, there are the ones that have accumulated so much cruft that they became unusable from today's standard (E.G: bash). Then you have those who have done like Python (E.G: perl 6). The ones that just tried and failed (PHP 6). The ones that broke compat and told everybody move or die (Ruby in a point release, gave basically 2 years). And the ones that created a huge pile of horror they called full stack to keep going (E.G: JS). Also those that got hijacked by vendors and just exploded in miriads of proprietary syntaxes (E.G: SQL) or completely new concepts (E.G: lisp).
At least, in Python you CAN write Python 2/3 compatible code, and you have a LOT of tooling to help you with that, or migrating.
So, yes, the Python 2 -> 3 transition could have been better. Insight is 20/20.
But I'm struggling to think of any other language in a similar situation that has done better.
If Python 3 had been introduced as a separate language, I'm pretty sure everyone would have said "Why isn't this just called Python 3? It's 99.9% the same as Python and it's by the same people and they're deprecating Python in favor of it."
That's obviously untrue. For example, consider the following Python 2 script:
with open('a.txt', 'r') as a, open('b.txt', 'w') as b:
for line in a:
b.write(line)
It works identically on a Python 3 interpreter, and it doesn't even use "from __future__ import ...".That is completely false. So many libraries have support both for 2 and 3. That's code that run just as well under both interpreter.
That is not true though, a lot of 2 scripts will run no problem, especially if import future is used
Perl 6 (now Raku), of course, but they at least had the decency to admit it.