

Ask HN: Python 3 or Python 2.7? - gareim

I've been meaning to learn Python for a long time now. I have no experience in programming (except for a few lessons of LPTHW). But in a month, I'm going to have a lot of free time on my hand and I've decided it's time to get off my bum and finally learn it.<p>But my question is, should I learn Python 3 and be future-proof or learn Python 2.7 and figure out the differences later on?<p>I'm on Debian Sid (Crunchbang to be specific) right now, but it isn't much of a problem to install Python 3.
======
sixtypoundhound
Don't worry about it. Learn Python well and you will be future proof, at least
as a developer.

I've got active projects in both code bases right now - although I prefer
Python 2.7 because it has taken a while for the libraries and frameworks to
move over to 3.0.

However, once you understand the core concepts behind Python, about 90% of the
differences between the two become obvious and trivial to work around for most
projects.

You should get some exposure to 3.x since Guido has indicated any significant
new language features will be implemented in that branch and not back-ported
to 2.7. They have also done a number of optimizations in the 3.x branch which
may be of interest for certain projects.

------
CyberFonic
There will be no Python v2.8 see: <http://www.python.org/dev/peps/pep-0404/>

I've been using v3.n for over a year, will probably go to 3.3 (currently in
alpha) when it is finalized. Once I did the v2 to v3 migration (less than a
week's effort) I never had to look back.

If you are learning and not locked into any old framework, then go with v3.2.
All the "batteries included" stuff is available in v3.n and most gnarly stuff
has been cleaned up. Whilst some excellent independent frameworks haven't been
ported, I would prefer to use stuff that is in active development and thus
ready for the future.

------
canatan01
I decided to learn Python a few days ago. I decided not to go with version 3
because I wanted the Python Image Library and mySQLdb module (or MySQL-python)
and want to learn Django 1.4 later on. All of those, if I have read everything
correct, do not work with Python 3 yet. So first decide what you want to do
with your new programming skill and then decide the version.

~~~
debacle
MySQL doesn't work in Python 3 yet? Hasn't Python 3 been out for years?

~~~
canatan01
I was surprised also. mysqldb and mysql-python don't seem to support it. If
you know of a mysql module for P3, please let me know.

------
martharotter
Depends what you want to do with it really. If you're planning on using Django
or Python Image Library, start with 2.7.

If you're not using any dependencies or frameworks relying on older versions,
start with 3.

Either way, as long as you work at it continuously, moving backwards or
forwards won't throw you off too much.

------
gareim
Hey guys, thanks for all the suggestions! I took a look at the links
(especially the wiki one) and after a lot of thinking, I've decided to go
ahead with 2.7 for now.

With 2.7, I can take advantage of LPTHW and some courses at Udacity. And like
you guys said, if I learn 2.7 well, moving to 3 isn't that hard.

So thank you all for the comments and suggestions, they helped a LOT. :)

------
axitkhurana
<http://wiki.python.org/moin/Python2orPython3>

------
glimcat
Python 2.x is the one that most people use.

Python 3 is a fork with broken compatibility and poor adoption.

------
read_wharf
Learn 2 and you'll be present-proof. Life's uncertain.

------
shire
probably 2.7 since 3 hasn't fully come out to all the world yet

~~~
CyberFonic
Python v3.0.1 was released in Feb 2009 - it's had three years and two major
releases since. I think v3.2 is pretty solid and much improved in many areas.

