views:

690

answers:

7

I am extremely new to python, having started to learn it less than a month ago, but experienced with some other programming languages (primarily C# and SQL). But now that Python 3.0 has been released and is not backwards compatible, what would be the advantages and disadvantages of deciding to focus on Python 3.0 or Python 2.6?

+6  A: 

Since they have incompatibilities, I suggest you start going for Python 3.0 which is more useful in the future anyway. It's a better language. You can see the precise differences in What's new page on its Web site.

Mehrdad Afshari
+12  A: 

Go with 2.6 since that's what most libraries(pygame, wxpython, django, etc) target.

The differences in 3.0 aren't that huge, so transitioning to it later shouldn't be much of a problem.

Corey
+5  A: 

I would say begin with 2.6 since the vast, vast majority of documentation regarding Python will be applicable to 2.6 as well most open source projects you may want to contribute to will be in 2.6 for awhile. Then, once you have a good foundation in 2.6, you can learn 3.0. That way you can kind of appreciate how the language has evolved and where the "aesthetic" of the code comes from.

BobbyShaftoe
Thanks. This was very helpful. I actually ended up going with Python 2.5 for the time being, primarily because SciPy has not yet been fully ported to 2.6 or 3.0 yet and I found I need scipy and Numpy for some of the things I am trying to do.
TimothyAWiseman
+1  A: 

Be careful though. Libraries such as the mysql driver are still in 2.5

+3  A: 

Start with 2.6, and when you get a bit more proficient with the language (few thousands of lines of code written), transitioning to 3.0 will be easy and natural. While learning I suggest you ignore classic classes, and pay special attention to iterators, generators, and list comprehension.

Mosor
+2  A: 

It depends on what you are willing to do.

Python 3.0 is the newer release, and with time should become the standard. However, it has almost no libraries or frameworks available, and even the tools are not so up to date (e.g. the Eclipse plug-in for Python is still in the migration phase).

On the other hand, there are no huge differences, and once you learn one, moving to the other is quite easy.

So, if you plan just to play around, you can go with 3.0. If you plan to use it on a new project, I would stick on an older release.

Roberto Liffredo
+1  A: 

If you're looking at it from a getting-a-job perspective, I'd definitely at least learn 2.x as well. The code I work on is still targeting python 2.4 and to the best of my knowledge there is no plans to move to even 2.6, let alone 3.0 in the near future. There will be a ton of 2.x python code floating around for years to come and the vast majority of python jobs will involve working with that code.

So I'd start by learning python 2.6 while the whole time keeping an eye on 3.0 so that you are at least aware of what bits of your 2.x code won't work in 3.0