Debating a "transitional" Python 2.8
Python 3 has been around for five years now, but adoption of the language still languishes—at least according to some. It is a common problem for projects that make non-backward-compatible changes, but it is even more difficult for programming languages. There is, typically, a huge body of installed code and, for Python, libraries that need to be upgraded as well. If the new features aren't compelling enough, and the previous version is already quite capable, it can lead to slow adoption of the new version—and frustration for some of its developers. Solving that problem for Python 3 is on the minds of some.
Recently, Alex Gaynor, who has worked on core Python and PyPy, expressed his concerns that Python 3 would never take off, partly because the benefits it brings are not significant enough to cause projects and users to switch over to Python 3. After five years, few are downloading packages for Python 3 and developers aren't moving to it either:
That leads to language stagnation at some level, Gaynor said. Everyone is still using Python 2, so none of the features in 3.x are getting exercised. Since Python 2 is feature frozen, all of the new features go into versions that few are using. And it is mostly Python-language developers (or others closely related to the project) who are using the new features; the majority of "real" users are not, so the feedback on those features may be distorted:
Gaynor concluded that the divergence of Python 2 and 3 has been bad for the community. He suggested releasing a Python 2.8 that backported all of the features from Python 3 and emitted warnings for constructs that would not work in Python 3. That, he said, would give users a path for moving to Python 3—and a way to start exercising its new features.
As might be guessed, not all were in favor of his plan, but the frustration over the Python 3 adoption rate seems fairly widespread—at least with the commenters on Gaynor's blog. So far, the conversation has not spilled over to python-ideas or some other mailing list.
Alan Franzoni agreed that some kind of transition path, rather than an abrupt jump, is needed.
David A. Wheeler and others agreed with Franzoni, but "rwdim" felt that Gaynor did not go far enough:
Burn the ship and force people to move ashore or go away.
In addition, rwdim suggested that the Python package index (PyPI) stop serving packages that are not Python 3 compatible at some point. That last suggestion was not well received by PyPI maintainers and others, but it did attract other semi-belligerent comments. For example, "jgmitzen" likens users sticking with 2.x to terrorists (and to the Tea Party in another comment). While perhaps a bit overwrought, jgmitzen's point is that supporting 2.x in the Python ecosystem is taking time and energy away from 3.x—to the detriment of the language.
But "gsnedders" is not sure that a 2.8 really brings anything to the table. In the libraries that gsnedders maintains, things have gotten to the point where a single code base can support both >=2.6 and 3.x, and that should be true for most projects. The more recent feature additions for Python 3 are in the standard library, which means they are available for 2.x via PyPI.
Like rwdim, Sean Jensen-Grey would like to see an evolutionary approach so that a single interpreter can be used with both Python 2 and 3. In another comment, he referenced a March 2012 blog post from Aaron Swartz that outlines his vision of how the Python 3 transition should have worked. It followed the established pattern of adding new features to Python 2.x, which is clearly an evolutionary approach.
But Python 3 set out with a non-evolutionary approach. Python Enhancement Proposal (PEP) 3000 clearly specified a break with 2.x backward compatibility. The question seems to be: is it time to rethink that strategy in light of the slow adoption for Python 3?
It may simply be a matter of time, too. Linux distributions are starting to plan for shipping Python 3 as the default—some already have made the switch. Those kinds of changes can only help spur adoption, though it may still take a while.
In addition, Some don't seem convinced that Python 3 adoption is lagging, or at least that it is lagging as badly as is sometimes portrayed. To start to answer that question, Dan Stromberg has put together a survey on Python 2.x/3.x use. Whatever the outcome of that, though, it seems likely that many core developers are less than completely pleased with where Python 3 uptake is today—and will be looking for ways to improve it.
Posted Jan 2, 2014 4:13 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Python developers should ask themselves what's more important to them: designing a new language or doing something that is useful for the developer community?
Posted Jan 2, 2014 14:40 UTC (Thu)
by vstinner (subscriber, #42675)
[Link] (1 responses)
"Since Python 3.2, a subset of the API has been declared to guarantee a stable ABI."
Before Python 3.2, no effort was put to maintain the stability of the ABI.
With Python 3.3, there is no more narrow or wide build for Unicode strings, but I don't know the impact on the ABI.
Posted Jan 2, 2014 14:46 UTC (Thu)
by Cyberax (✭ supporter ✭, #52523)
[Link]
Posted Jan 2, 2014 6:40 UTC (Thu)
by dlang (guest, #313)
[Link]
There will be no feedback from the people who have python code they are running that is 2.x only because they don't know or care about python 3
most people who use a language are not involved with discussions about changing it (or if they are, the language is either very new or breaking a lot)
Getting to where one binary can run both python 2 and python 3 code would be a very good starting point. After that the debate can begin about disabling features. That will be an interesting debate, as most of the time the people trying to turn them off are justifying doing so 'for their own good', which won't make people who have code that gets broken very happy.
Posted Jan 2, 2014 7:50 UTC (Thu)
by osma (subscriber, #6912)
[Link] (1 responses)
I mean, of course you can have something like a wrapper that detects the code flavor and selects the proper interpreter internally, but I think the interesting scenario would be having support for mixed 2.x/3.x code bases where only part of the code is ported / written to 3.x.
Posted Jan 2, 2014 23:38 UTC (Thu)
by david.a.wheeler (subscriber, #72896)
[Link]
Posted Jan 2, 2014 14:10 UTC (Thu)
by vstinner (subscriber, #42675)
[Link]
You may be interested to read it because it is somehow related to the discussion:
Posted Jan 2, 2014 19:57 UTC (Thu)
by iabervon (subscriber, #722)
[Link] (2 responses)
For example, it could still recognize the print statement by default, but consider it deprecated or illegal. If you want to use "print" you need "from __future__ import print_function;" and to use it as a function, but it also doesn't just start handling things the new way. Likewise, it understands ambiguous "except" clauses the 2.x way, not the 3.x way, but it prohibits it.
Personally, I think the biggest impediment to Python 3 adoption is that it lacks support for "unicode" and the "u'foo'" syntax. Other than that, it would be possible to have a 2.8 that makes you write version-agnostic code, but there's no way to get Python-3 strings that also works in 2.7 for 2.8 to demand.
Posted Jan 4, 2014 23:15 UTC (Sat)
by juliank (guest, #45896)
[Link] (1 responses)
Posted Jan 4, 2014 23:47 UTC (Sat)
by iabervon (subscriber, #722)
[Link]
Posted Jan 3, 2014 2:22 UTC (Fri)
by therealmik (guest, #87720)
[Link] (1 responses)
Adding some more __future__ statements might help (eg. a proper bytes class and the new exception syntax) - once I've written python3 code it's really hard to backport.
Posted Jan 7, 2014 1:59 UTC (Tue)
by dave_malcolm (subscriber, #15013)
[Link]
Posted Jan 6, 2014 21:51 UTC (Mon)
by michaelkjohnson (subscriber, #41438)
[Link]
I posted about this on G+ as part of this discussion. Recapping and expanding here: The Python development community made it unnecessarily difficult to migrate from Python 2 to Python 3 by creating incompatibilities without an ecosystem-aware migration strategy. They did this intentionally; see PEP 3000. So by design, we have in fact two languages, separated by a common heritage. But the language developers then try to use persuasion to convince us to join them in a pretense that there is really only one language. When, years after a new language version release, the language development community continues to have to harangue people to try to convince them to move, they should reconsider the source of the problem. This downplays the complexity of the Python ecosystem. Developers aren't always in complete control of the process of adapting syntax. For example, when Python is adopted as an internal "scripting" language, the developer (of the container) doesn't have control over the user-provided scripts, and thus moving to an incompatible version is a cost to the end user that doesn't bring benefits to that user. This is hard to coordinate! The implicit assumption that Python is only an implementation language undervalues embedded python. I remember early Python documentation specifically calling out Python's strengths as an embedded interpreted language. Those burned by being ignored are likely to be looking toward other language families in the future. I have nothing against (for example) Lua, but I know Python better, and perhaps it is selfish for me to wish that Python were being managed with better care for this use case, and to regret that this language I enjoy so much will be used less as the result. A transitional Python 2.8, especially if it is combined with reconsidering the things that were (from the point of view of a user) broken just for the sake of doing things differently and not for any actual advantage, could be a benefit for this ecosystem.
Debating a "transitional" Python 2.8
Well, so does maintaining strict backwards-compatible ABI in Linux.
Stable ABI
http://docs.python.org/3/c-api/stable.html
Stable ABI
Debating a "transitional" Python 2.8
Debating a "transitional" Python 2.8
Debating a "transitional" Python 2.8
Why should OpenStack move to Python 3 right now?
http://techs.enovance.com/6521/openstack_python3
Debating a "transitional" Python 2.8
Debating a "transitional" Python 2.8
Debating a "transitional" Python 2.8
Debating a "transitional" Python 2.8
Python 3 on RHEL
Myopic view of Python ecosystem
