Python的一些版本分析

來源:互聯網
上載者:User

標籤:rem   例子   aspect   out   turn   nsis   字元   uft   活躍   

Python 2.6 - October 1, 2008
Python 2.6.1 - October 1, 2008
Python 2.6.6 - October 1, 2008
Python 3.0 - December 3, 2008
Python 2.7 - July 3, 2010 #目前業內主流使用的工業版本依然是2.7

print "hello world" #in 2.x
print("hello world") #in 3.x


In summary : Python 2.x is legacy, Python 3.x is the present and future of the language

總結: python2.x 是遺產, python3.x是現在和未來的語言

Python 3.0 was released發布 in 2008. The final最終 2.x version 2.7 release came out in mid-2010,
with a statement聲明 of extended延長 support支援 for this end-of-life release. The 2.x branch分支 will see no new major重大 releases after that.
3.x is under active development 正在活躍的開發 and has already已經 seen有了 over超過 five years of stable穩定的 releases版本, including包括 version版本 3.3 in 2012,

3.4 in 2014, and 3.5 in 2015. This means意味著 that all recent近期的 standard標準的 library庫 improvements升級/改進, for example例子, are only

available可用的 by default預設 in Python 3.x.

2.x = 預設編碼 =ASSIC =不支援
3.x = 預設編碼 =UNICODE =預設支援中文

 

Guido van Rossum (the original creator of the Python language) decided決定 to clean up清理 Python 2.x properly適當的, with less regard不管 for backwards向後 compatibility相容 than is the case for new releases in the 2.x range. The most drastic激進的 improvement is the better更好的 Unicode(是一個編碼)中文支援 support (with all text字元 strings being Unicode by default) as well as saner bytes/Unicode separation.

Besides另外, several幾個 aspects方面 of the core核心 language (such as print and exec being statements, integers using floor division) have been adjusted調整為 to be easier更簡單的 for newcomers新手 to learn and to be more consistent持續的 with the rest of the language, and old cruft has been removed (for example, all classes are now new-style, "range()" returns a memory efficient iterable, not a list as in 2.x).

 

python 2 vs 3
1。 預設支援中文
2. 不相容2.x
3. 核心文法調整,更易學
4. 新特性預設只在3.x上有

Python的一些版本分析

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.