Why Python 4.0 won’t be like Python 3.0
developerblog.redhat.com
developerblog.redhat.com
He may know what he's talking about, but being a core python developer certainly doesn't necessitate that in my books.
They are humans, they have made mistakes. But you can't seriously argue that the majority of their decisions have been mistakes.
PHP is also widely used, but I wouldn't say the developers of PHP have made good decisions.
beautiful??? Atrocious more like.
Python is terribly put together (I'd say designed but it's clear no such process has taken place). It's a language that, like PHP and to some extent Perl before it, rewards idiotic behavior, makes it extremely easy to end up with horrible unmaintainable code and requires strict discipline and a lot of experience in order for it to "work" in anything that's not exploratory/throw-away in nature.
Of course the (mostly?) clueless masses love it, because they feel empowered. But really ask yourself, what has Python brought to the table in terms of paradigm shifts? It's no Lisp, Haskell or Ocaml.
Hell, even Java looks to be better, especially for beginner/mediocre programmers.
Bleh.
That is what it means in SemVer, but SemVer is not a law. The author is the Director of the Python Software Foundation, so he's probably the second most qualified person in the world to comment on what the standards will be for 4.0 (the BDFL being the first).
He's essentially saying Python 3.x will be the last "major version" of Python as SemVer would describe it, but future bumps to the version number will be driven by decimalization rather than SemVer.
OTOH, while the current 2/3 split and maintenance of single source libraries may encourage "documented deprecation" as described in the article, that approach -- with no programmatic deprecation warnings and, consequently, never actually pruning the code of deprecated features, can't be a permanent state of affairs, if Python and its standard library are going to be maintainable in practice -- suggesting that it would be is essentially committing to unbounded accumulation of technical debt in the Python code base.
If PSF Python goes this way over the long term, I expect eventually a more nimble, decrufted fork will replace it for new development, with PSF Python relegated to legacy use.
I'm not sure where you are getting that idea from? PEP 387[0] does indeed recommend programmatic warnings through the `warnings` module and eventual removal of deprecated features.
[0]: http://legacy.python.org/dev/peps/pep-0387/#making-incompati...
From the article we are discussing (emphasis added):
---quote--
the widespread development of "single source" Python 2/3 libraries and frameworks strongly encourages the use of "documented deprecation" in Python 3, even when features are replaced with newer, preferred, alternatives. In these cases, a deprecation notice is placed in the documentation, suggesting the approach that is preferred for new code, but no programmatic deprecation warning is added. This allows existing code, including code supporting both Python 2 and Python 3, to be left unchanged (at the expense of new users potentially having slightly more to learn when tasked with maintaining existing code bases).
---end of quote---
I dislike when people make promises about something set to happen a decade from then. Elected presidents can't keep their promises straight within half of that time and almost nobody remembers them. Promises which are aired on peak time TV to hundreds of millions of households. Who's gonna remember a blog post?
[0] https://twitter.com/gvanrossum/status/501172370690699265
> Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API. It MAY include minor and patch level changes. Patch and minor version MUST be reset to 0 when major version is incremented. [Emphasis added]
I believe the intent of the sentence I've italicized is that while backwards incompatibility requires incrementing the major version, the converse is not necessary: a major version bump does not require backwards incompatibility.
Not that he has no reason for whining, he is just a bit overdramatic regarding some Python 3 issues - but since English is not my first language this impression may be the language barrier kicking in.
This is one of the reasons why I like his code, I find all his projects inspiring.
Py3k should have been a big change, big pain and serious gain, but was instead a small-ish change, big pain and little gain. After the suffering around Py3k, I wish the Python team would say "Py4k is going to be a big change because we're going to: clean up all inconsistencies, get rid of the GIL, focus on performance, etc". Py1-3k had a great 20 years; Py4+k should provide a further 20 years and I don't get that feeling from this article.
Fortunately, the maturation time for new languages has really shortened and fantastic, practical languages are becoming mainstream (go Rust!). I expect to be mostly off of Python in a few years...
Ocaml, F#, Common Lisp, Scala/Clojure (if JVM) are languages that blow Python out of the water for anything that's not scripting/throw-away code.
(To clarify: I don't think a huge split should happen as it did previously from 2 to 3 but I do think that there should be a dev stream for implementing major new features)
What they are saying is that they won't introduce changes that break the way already existing code works, like they did by changing the underlying behavior of existing types. I think this is a reasonable compromise that allows for software developers to get access to new features, while at the same time refactoring their code once migrated to a new runtime.
"We can't change A, so let's add B which does A, but better" ... a version later ... "well, B didn't work out either, here is C".
There will of course be backwards incompatible changes introduced through a normal deprecation cycle. No one is suggesting Python remain static forever.
That may be what you'd prefer a major version number change to indicate, but the Director of the Python Software Foundation might have more insight than you into what the next major version number for Python will actually mean.
At any rate, the point of the article was that Python 2 to Python 3 levels of disruption are not going to happen again and that people waiting for that (the "Python 4000" people) are going to be disappointed, so they should stop proposing disruptive and non-backwards compatible enhancements that aren't compelling.
Where he says "no major backwards compatibility breaks" is important.
edit: more succinctly, "don't worry, we won't pull a 2 to 3 level move again any time soon, if ever"
History tells otherwise. I bet when they released Python 2 they were not expecting to break the APIs years ahead.
[0]: https://mail.python.org/pipermail/python-ideas/2011-Septembe...
Because the vast majority of the world's languages cannot be handled solely using ASCII?
That's exactly what Python did. It's also a problem, because it's a change in a core feature of the language.
I think a better idea would be to have a string type that is encoding-agnostic (and internally might depend on compilation switches) but conceptually isomorphic to numbers in the range [0, 2^32) and a binary-data type which may have an encoding "annotation". And then the string type should be mostly not used, especially in the standard library. That way the cost of dealing with transformations among various encodings will be borne by those who care about those encodings, which isn't something that can be said of python3.
If one were developing a language from scratch, it would also be convenient that loads of legacy code doesn't assume the triviality of transformations between strings and binary data, or between different encodings of binary data. Obviously python3 couldn't rely on this convenience, but I wonder if we weren't making more trouble for ourselves by setting an expectation that str would be used all the time, and bytes only when absolutely necessary. I suspect the opposite custom would have been less troublesome.
I really have to wonder how in-touch the python high command is with the community as a whole.
I really wish Python 3 had been about concurrency and making it a part of the core of the language. There are over a dozen different python concurrency packages out there and most of them are pretty different from each other. It's confusing as all get out, and we end up religious wars over which one to use.
In Python's case, my guess would be that PyPy will be the the implementation that makes this mainstream.
... which I think is great that he really took the time and Pep 3156 is the better for it. I still feel like this should have been what Py3K was about though, and not tightening up semantics in the language. Who cares about the semantics? Python has warts but we love it anyway.