Python 2 vs 3 - which one to learn?

hotshot05

Skilled
Django has still not been ported to Python 3.
My objective is creating general applications using Python. Even though I talked about Django, I was just using it as an example. I am not focused solely on Web Development.

I was looking at starting out through Byte of Python by Swaroop Ch(http://www.swaroopch.com).
The book for Python v2 was last edited in 2005 (I think), while that for Python v3 is being maintained even now(last edit 27th May 2013).

So, should I start out with an outdated book? Or should I start with v3?

Many people have mentioned that learning Python v2 first and then moving over to v3 is much easier than the other way round.
 
I started python last month and i decided not to touch 2.x for the following reasons:
- all new developments will be done with newer Py3.
- sooner or later old things will be moved to py3.
- learning py2 will be waste of time as in next two years py2 will go obsolete (my anticipation).
 
I have been using Python for sometime now.

For people who are just starting with the language, they can choose any version. Its not like Python 2 will become obsolete in next 6 months. The basic structure of programming remains almost the same in both.
But if you are a seasoned programmer in some other language, then start with v3. You will find the deeper level changes to be more programmer friendly.

For people who are developing something specific using frameworks like Django, they should start with the supported version. Will save them time. In course of time if the version is upgraded, you can move along too.

This is a nice article : http://docs.python.org/3.0/whatsnew/3.0.html
 
For enterprise solution Py3 is yet not stable :(. Lots of important libraries are missing. But those important libraries are well established in Py2. And yes you are not going to reinvent the wheel right? So if its for solution writing don't look here and there, Py2 is the way to go. But if you are well seasoned in Python then yes you can go to Py3.

For me, I use a language like a tool. I don't touch any tool unless I need it. Saves my time.
 
For enterprise solution Py3 is yet not stable :(. Lots of important libraries are missing. But those important libraries are well established in Py2. And yes you are not going to reinvent the wheel right? So if its for solution writing don't look here and there, Py2 is the way to go. But if you are well seasoned in Python then yes you can go to Py3.

For me, I use a language like a tool. I don't touch any tool unless I need it. Saves my time.

Can you tell me which packages are not yet available in Python 3?
I am a student. I am only going to learn Python, not using it in production systems as yet.
 
@hotshot05 - Twisted, Flask and Django(1.5 is 3.x complaint but experimental) just for example. I am sure there are lot of other libraries which need work on moving to Python 3.

IMO knowledge of difference in these will also help.
 
Last edited by a moderator:
@random2 Since I will begin learning Python just now, will I need these libraries just now?
And when I will need it, will I not be able to just use my existing knowledge and list of the differences between v2 and v3 to run those libraries?
 
Last edited by a moderator:
@hotshot05, you can very well start with Python 3. No issue at all with that.
I am not sure what you would be using Python for. So cannot say what you would need.

If you want to practice by just following books/documentation, Python (i.e standard library) has got enough to keep you busy for a long time.

I would suggest you to take couple of problems and try to solve it using Python.
 
Last edited by a moderator:
The big deal with Python 3 is that there are a few backwards-incompatible changes, eg. 'print' is no longer a statement, it's a function.
The big deal is not that there is some massive mental hurdle to overcome when moving from 2 to 3. As I've said before, you will not harm yourself in any way if you start out with Python 2.
If one plans to use various 3rd party packages, they'll have a smoother time with Python 2 at this time. Python 3 support is slowly being implemented, but will still take a while.
If wide scale 3rd party support is not an issue, then might as well go with 3.
 
Back
Top