开发者

Python version differences

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?


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.


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.


No, the big differences came from python 2.x to python 3

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜