Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python version differences

Tags:

python

version

I got a book for python 2.5 but up until now I've been using 2.7. Will there be any huge barriers to overcome?

like image 473
JShoe Avatar asked Mar 06 '26 22:03

JShoe


2 Answers

No, Python 2.7 is compatible with 2.5. There were a few features that were added, but everything you learned from 2.5 should work in 2.7.

Python 3, on the other hand, makes some big changes that are not compatible with 2.5.

like image 52
mipadi Avatar answered Mar 08 '26 10:03

mipadi


The 2.x versions are (generally - if 2.x had a bug somewhere and some fool writes code that takes this incorrect behaviour for granted, upgrade to 2.(x+1) will of course change the behaviour) backwards-compatible. So the examples written for 2.5 should run fine for 2.7.

Note though that you're missing out several cool features added in 2.6 and 2.7, including with statements for easy resource management and more, new string formatting, new kinds of integer literals, dictionary and set comprehensions. Also countless improved and new modules.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!