Python 3 is also not meant to run Python 2.x code. It's pretty trivial to port most code from Python 2.x to Python 3, but there's no real reason to do so unless you're writing a library or other project for other people to take advantage of.
It was intentionally done as a 'clean break' release; 2.x keeps doing the same stuff it used to do, and Python 3 changes a bunch of stuff which, in hindsight, makes sense (such as a distinction between 'stream of bytes' and 'string of text', vs. 'stream of bytes which may or may not be ascii text' and 'string of unicode text').
That said, there's no real benefit to moving an existing project/codebase from 2.x to 3.x, and it was never intended that there would be one. Python 3 is for new projects; Python 2.x is for existing projects, or new projects which need deployment in older environments.
And also, you'll find more bugs in Python3 libraries. They're being used less than Python2 libs. That, and the long tail of libraries that may never get moved to Python3. There's really a lot of reasons to not use 3, or like me, wait to see if it ever really overtakes 2.
A 3rd extra reason if you needed any more, is that almost all jobs in the field use 2.x. I tried to love Python3, but the technical reasons just don't make sense to migrate, and once you meet the coercion and vitriol of the Python3 community, you'll learn to resent its existence and them.
The future of Python2 is actually very bright, while 3's is in jeopardy. That's why everyone is so pushy about it, they lose their bet if it never gets over the hump. Being as 3.0 was released in 2008 and it's now 2015, I honestly think that answer is already here.
Using 2, then switching to 3 if it ever does overtake it makes a lot of sense and is the sensible bet. But 3.x overtaking 2 anytime soon is really unlikely, and library worth anything will be 2+3 compatible and dropping 2 support would just be asinine with the ~83% userbase it holds today.
Even if Python3's userbase doubles in 5 years, it'll still be under 50% of the overall Python userbase. And I think doubling its current usage would be overly optimistic. Python3 will either collapse, or split the community (already has to a degree) with someone forking Python2 for good. Pyston may be that fork, or a couple other contenders.
The situation is a disaster all around. For Python and the community. Companies in some cases now aren't putting new product down in Python because of this.
You'll be alright using 3, because no matter the final outcome you'll be able to go back to 2 without issues and vice versa. I only recommend 2 because you won't be missing any libraries if you use it, and if you want to do it for a job you'll be using 2.x anyway.
Python3's biggest purpose is giving people a reason to hassle maintainers to port to it. They bite on the political propaganda surrounding 3, that it's the "newest version", which for programming languages is not always in best interests of the user unlike an up-to-date web browser. Then when they find out x doesn't work or exist in 3, they badger whoever wrote a library for 2 to port.
Those people really need to port it themselves and maintain it afterwards. They don't, and it's just an ugly situation.
For example, you can build iOS/Android apps using Kivy. Guess what, can't build for iOS unless you use 2.7! Just lots of surprises out there for those who start off wanting the "latest version". It's not the latest version, it's a new, breaking language. If you end up doing much cobbling with Python, this may be of interest to you.
I have my doubts 3 will get over the hump, and just plan on waiting till the complainers turn into maintainers and 99% of everything is ported. Then I'll use Python3 if I don't find something else I like more before then.
If you're doing something completely new that will never interact with older code bases, Python 3 seems like the best choice. This is where the language is ultimately going.
However, if you have to integrate with almost anything in 2.x land, such as 3rd party libraries, you may have no choice but to keep using 2.x for awhile. As usual, even from this older version, there are ways to voluntarily import future capabilities so that your code is as 3.x-like as possible.
I still use python 2 because I'm not the best programmer and most stack overflow answers are python 2 based (although more and more are for both now-a-days). I wouldn't be opposed to using python 3, but see no real reason to do so.
What benefits does upgrading from python 2.x to 3 have? Why would you undertake that task? I don't understand why, unless python 3 offers some extremely compelling feature, or you are one of the small percentage of developers who delivers importable python libraries as your main developmental output.
You don't have to learn Python 3, and there are plenty of cool features (ok well being cool isn't always enough reason but it is a reason) and there are libraries that are not supported on 2.x anymore.
Also you don't have so much longer until support drops entirely for 2.x, and then you really should port your projects. Why wait and port? Just write them in 3.
There is nothing wrong with 3. Just starting in 3 is easy and not an issue. It is basically the same language.
No reason per se. Just that lots of people have lots of Python2 code and feel that Python3 doesn't offer anything interesting enough to make it worthwhile to go through the effort of porting their code.
Are you using Python 2.X because you are maintaining existing code, or because Python 3 is just plain unsuitable for what you're trying to do?
I hear a lot of complaints about Python 3, but in my (limited) experience, 3 is better than 2.X in practically every situation I've experienced. But I've never had to maintain anybody's old code in it, either.
But ultimately isn't the first choice for most Python projects to date. So many scripts have python paths expecting python 2 hardcoded and pretty much everything that wants python3 calls python3. I'm firmly against this for compatibility reasons, it breaks too much.
The only major reason to use 2 instead of 3 is library support, however a lot of good libraries still aren't updated to Python3, such as the google-api-python-client, gevent, scrapy, the list is getting smaller every day though. There are a few other reasons, but they're pretty uncommon/advanced, and not something new users will encounter [0].
Python 2 gets many of Python 3's features back-ported (they can be enabled with an import statement), which is really convenient when working with 2, but it also helps contribute to the lack of a migration from 2 to 3.
Python 2 and 3 are very similar though, and most projects can even run under either 2 or 3 with the exact same codebase. So it doesn't take much effort (or none at all) to move a project from 3 down to 2 while still in early development if requirements necessitate.
[0] One example that comes to mind is a difference in the way str.format() works. In Python 3, strings are unicode text objects, in Py2, they are bytestrings. Some projects used str.format() in Py2 to format binary data rather than text, which breaks when moving to 3. Porting a compatible change to Py3 has been rejected several times because of the complexities in implementation, as well as it being unidiomatic to the language. See:
That's not for the manufacturer to decide. Python 3 is like Coca Cola declaring that the New Coke is all people should drink, and stopping production of classic coke.
Python 2 is still being "worn" by millions of programmers, and is what runs in the biggest installations. This includes new code written for those installations, that it's written to run in the same 2.x environment.
reply