views:

1338

answers:

5

Maybe I'm old school, but when I sit down to really tackle a new language I like to buy whatever the definitive book is for that language rather than mess around with tutorials and online intro "toys" to the language.

Python in a Nutshell has gotten glowing reviews on Amazon, but it's written around Python 2.5. So far it looks like Programming in Python 3 is the only Python 3 book on the block, without any reviews to vouch for it.

If any of you current Pythonistas were to start learning the language right now, would you buy the "nutshell" book and continue working with the 2.x branch, or is Python 3 going to be taking over soon? From what I understand there are some significantly incompatible differences in the versions, which is why I ask.

I've been coding for a while if that makes a difference. I don't need an intro to programming, just coverage of the language.

Thanks everyone.

+4  A: 

If you're going to work with old Python code, it is probably a good idea to have some knowledge of Python 2.x, simply to be aware of the differences. If you're starting from scratch and won't need to deal with any 2.x code, learn just 3.x.

It is probably a year or two too soon to really only learn Python 3.x.

Jonathan Leffler
+5  A: 

I've also began learning python recently. I decided to start with 2.5/2.6, as almost all 3rd party libraries are still only 2.5/2.6 compatible. The difference between 2.5/2.6 and 3.0 doesn't seem really big. When 3.x becomes mainstream one should be able to switch easily.

BTW, I read Mark Summerfield's PyQt book's introductory Python chapters. They were quite helpful. I'd say a book from him is definitely worth looking into.

Imran
A: 

Magnus Lie Hetland's Beginning Python: From Novice to Professional, Second Edition supposedly covers python 3. i haven't read the second edition, but i loved the first edition. and as the others said, if you're going to be using any libraries you might as well learn python 2 since a) at least at a high level, the backwards incompatible changes are fairly minor and b) all the libraries will be on 2.x for a probably a year or so.

Autoplectic
A: 

python3 is not different from python2.5 by couple of basic things. There's some things that behave different though.

I'd propose you to use python3 because they have fixed the problem with unicode and normal strings. Unicode strings are the strings and what they called 'str' is not a string now.

Only reason to use python2.5/2.6 is if you want to use libraries outside the standard libraries. Some of those may have python3 support already though.

Cheery
+1  A: 

while there are enough differences, python 3 is not a new language. And python 2.x will be here for a long time still. Imho you're safe to start learning python 2. Keep in mind btw, that 'Python in a nutshell' is a (good) reference guide, not a tutorial!

wzzrd