"I would say there is currently no “right” or “wrong” as long as both Python 2.7.x and Python 3.x support the libraries that you are planning to use."
I would like to consider python for my next project, but this is extremely short sighted advice which begs the very real question: why should I consider python at all for a new, multi year project when there is no clear path forward for the language and there hasn't been in a decade?
Also, how can you ask someone who is new to the language to just choose? To me that seems insane. They have nothing to base their choice on, yet this choice will decide the future and success of the app. No pressure. But to be honest, and I know this is not the community's intention, the python 2/3 split is about as unwelcome a reception to a programming language as I can imagine. Is there a more logical way to choose?
Finally, I've now seen clients demand rewrites of python 2 code because of (probably bullshit) concerns around its obsolescence and lack of security. Now these clients generally don't know python from their ass and I doubt they have valid technical concerns but as invalid as their concerns probably are, it's still a major issue of your big clients threaten to leave unless you rewrite all your python 2 to 3. Anyone faced this?
The way forward is to use Python 3. That's been the way forward since it was announced that 2.7 would be the last version, and that everything after it would just be bugfixes. The way forward became even more clearly defined when the date was set for even those to stop.
I learned Python from Python 3, and it hasn't hindered me at all, even from going back and working on Python 2 code bases, or cross compatible code bases. It's a perspective that's made me just how aware of how awful Python 2 is in comparison.
Python 2 is going to exist for a long time in a lot of places. But it's a dead end for improvements. It's a dead end for innovation. It's a dead end for bug fixes and security fixes. Would you even consider telling someone to go learn any other language that is 3 years away from even end of life support having the plug pulled? You wouldn't. Why would you do the same for Python 2?
> Python 2 is going to exist for a long time in a lot of places. But it's a dead end for improvements. It's a dead end for innovation. It's a dead end for bug fixes and security fixes.
One the one hand I have this from you, an anon as far as I'm concerned. On the other I have Google, filled with some of the world's best python developers (and until recently the BDFL Guido van Rossum himself). Google App Engine still doesn't support Python 3.
You're both half-right: the "standard" App Engine environment is "Python 2.7 only", via the link you just gave. The newer, flexible env (with less bullt-ins) does 3.x too.
Right, because Google likely has a tremendous codebase which would prove difficult and costly to port. If they were making a decision today and had no existing python systems, do you think they'd choose the version that's going to be EOL in less than three years?
I've been listening to Python podcasts recently and this is certainly the impression I'm getting. Plus, there are always backports for those who cling to 2.7.
The link appears to be a few years old now, so its advice here I think is a bit out of date. And some might argue it would have been out of date in 2014 as well.
It should probably be updated to say that unless you have a VERY strong reason to use 2.7, use 3. And even then, probably still use 3, because your reasons probably aren't as strong as you think they are.
EDIT: Generally the strong reasons most people had for using py2.7 for new projects were some variant of: "X, Y and Z libraries I need only support 2.7". But now and days, that actually stands as more of a reason to find alternate libraries.
- code that has to run on HostGator shared hosting. They only support Python 3.2, the "maximally incompatible" version.
- code that has to run on ROS, the Robot Operating System. ROS is a huge collection of packages from various sources glued together by a message passing system. Efforts to convert all those packages to run under Python 3 have been underway for years, but aren't done yet.
Why does the code that "has to run on HostGator shared hosting" has to live there specifically, if you can say? It should be a simple project to move that code somewhere else.
I've never heard of Robot OS, looks interesting! Yea, unfortunately its the niche stuff like that which experience the most problems (or at least I assume its fairly niche - I do nothing with robotics).
In those cases, one can, without too much effort, write forward-compatible python 2 code at least.
why should I consider python at all for a new, multi year project when there is no clear path forward for the language and there hasn't been in a decade?
It would seem that the article is out of date and there is now a clear path forward. However, I think that we also see here a problem with the BDFL model of programming language governance. Unless Python 3 is somehow well over 2X times more productive than Python 2, I don't see the amount of disruption caused by the change as having been worth it. Is that the case?
I agree. I'm sure it's much easier for Python 3 core language development to happen versus 2, but for a regular joe what carrots are there, or is it really all sticks?
For system-related stuff, python 2 is already 'everywhere', as it's used all over the place for that kind of thing. Even some nodejs modules depend on python for their installation. But if you're going to be doing more than making a standalone script, python 3 should be your target: that's where the maintenance is going to live, and that is where any 'cool_new_module' gets targeted. If you're going to make something big, do it in an area that gets support.
I'm not a particularly advanced user of python (seriously, just ops scripts), but it looks like it's basically 'all sticks' to me. I've heard people grateful about better unicode handling, but not much more than that.
There's no reason those enhancements couldn't be part of 2 other than the maintainers decided to abandon the language for their own maintabity. That's their peragotive, but doesn't provide material benefits to the actual users.
The maintainers implemented enhancements in both 3.x and 2.x for many years. Eventually they got tired of it. Version 2.7 corresponds to 3.4. The reason why 3.5 is the first 3.x that started to gain a following was that Guido announced there'd be no 2.8.
You could argue that the reason folks didn't adopt 3.x quickly was that the core devs stayed committed to 2.x.
It's standard practice for software maintenance to work on both the old version and the new fork for a while, giving users a chance to switch. Look at how Microsoft manages versions of Windows. I think the Python devs stand out in their willingness to work on both versions for so long.
> why should I consider python at all for a new, multi year project when there is no clear path forward for the language and there hasn't been in a decade?
What does a "clear path forward" mean in the context of a programming language? In what way does python not have one?
>yet the choice will decide the future and success of their app
No it won't. I would argue that programming language choice generally has little effect on success, but it has even less effect when the languages are as similar as python 2 and 3.
>rewrites of python 2 code
Hardly a rewrite, I presume. They would need to change their syntax in some places, change package names in others, and any place they've dealt with strings might require some fiddling, but overall it would be relatively easy. Much easier than a rewrite at least.
There is a clear path forward. It's Python 3. The Python community unanimously agrees that the way forward is Python 3. Many libraries are planning to drop support before 2020, many have already dropped support, and the rest never supported Python 2 in the first place.
Python 2's official support ends in 2020.
How can you ask someone new to the language to just choose? Well they don't have to choose. They just choose Python 3. That's what it says on the Python website. It's what everyone in the community says.
I would like to consider python for my next project, but this is extremely short sighted advice which begs the very real question: why should I consider python at all for a new, multi year project when there is no clear path forward for the language and there hasn't been in a decade?
Also, how can you ask someone who is new to the language to just choose? To me that seems insane. They have nothing to base their choice on, yet this choice will decide the future and success of the app. No pressure. But to be honest, and I know this is not the community's intention, the python 2/3 split is about as unwelcome a reception to a programming language as I can imagine. Is there a more logical way to choose?
Finally, I've now seen clients demand rewrites of python 2 code because of (probably bullshit) concerns around its obsolescence and lack of security. Now these clients generally don't know python from their ass and I doubt they have valid technical concerns but as invalid as their concerns probably are, it's still a major issue of your big clients threaten to leave unless you rewrite all your python 2 to 3. Anyone faced this?