Python 2 vs 3 - which one to learn?

hotshot05

Well-Known Member
Veteran
Sep 11, 2008
2,288
391
171
Kolkata
hotshot05.page.tl
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.
 

nimod

Well-Known Member
Adept
Jan 7, 2013
595
325
102
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).
 

dp_008

New Member
Disciple
Jun 10, 2011
29
0
1
29
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
 

linuxtechie

Well-Known Member
ex-Mod
Aug 9, 2007
1,494
37
112
119
www.linuxtechie.net
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.
 

hotshot05

Well-Known Member
Veteran
Sep 11, 2008
2,288
391
171
Kolkata
hotshot05.page.tl
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.
 

random2

Well-Known Member
Adept
Nov 1, 2006
936
147
131
@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:

hotshot05

Well-Known Member
Veteran
Sep 11, 2008
2,288
391
171
Kolkata
hotshot05.page.tl
@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:

random2

Well-Known Member
Adept
Nov 1, 2006
936
147
131
@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:

Santa Maria!

Active Member
Disciple
Oct 27, 2011
184
38
41
32
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.
 
  • Like
Reactions: nimod