Python的歷史

維基百科,自由的百科全書
跳至導覽 跳至搜尋
File:Python logo 1990s.svg
舊Python標識,1990年代–2006年
File:Python logo and wordmark.svg
新Python標識,2006年–目前

package.lua第80行Lua錯誤:module 'Module:Format link' not found

Python是在1980年代後期所構思出來的編程語言[1]並於1989年12月[2]荷蘭CWI吉多·范羅蘇姆開始進行編程發展。Python繼承ABC編程語言的特性,能夠處理異常的狀況;並與阿米巴作業系統英語Amoeba (operating system)(Amoeba)交互運作。[3]范羅蘇姆是Python的主要編程者,他在決定Python發展方向等方面的持續核心作用當中扮演著重要的角色、這些分量都反映在Python社區給他的頭銜中;即是所謂的終身仁慈獨裁者[4][5] (不過范羅蘇姆於2018年7月12日卸任Python研發的領導者[6])。Python一詞是以BBC電視節目蒙提·派森的飛行馬戲團之名名之。[7]

Python 2.0版於2000年10月16日發布的,具有許多主要的新特性,包括用於記憶體管理的循環檢測垃圾回收器(除了引用計數之外)以及對Unicode的支援。不過,Python最重要的變化是開發過程的本身,具有轉向更加透明、以及Python社區強大的技術支援。[8]

Python 3.0版是一個主要的"向後不兼容"(backwards-incompatible)版本,經過長時間的測試之後,於2008年12月3日[9]發佈。Python 3.0的許多主要功能也被向後移植到"向後兼容"(backwards-compatible)的Python 2.6以及2.7版本,儘管這種Python 3.0"向後移植"的方法目前不怎麽受支持。[10]

版本3相對版本2的主要變化[編輯]

Python3相較於Python2的變化主要在以下幾個方面[11]

  • 除法運算符/在Python 3.x內總是返回浮點數。而在Python 2.6內會判斷被除數與除數是否是整數。如果是整數會返回整數值,相當於整除;浮點數則返回浮點數值。要讓Python 2.6統一返回浮點數值,可以from __future__ import division
  • print語句沒有了,取而代之的是print()函數。可以使用2to3工具來自動轉換。Python 2.6與Python 2.7部分地支持這種形式的print語法。Python 2.6要支持完全新的print()語法,可以from __future__ import print_function
  • 取消了exec語句,只剩下exec()函數。Python 2.6已經支持exec()函數。
  • 移除Python 2的input函數,並將raw_input函數重命名為input。Python 3的input函數表現得如同Python 2的raw_input函數,在其中輸入總是作為字符串返回而非作為表達式求值。
  • 捕獲異常的語法由except exc, var改為except exc as var。使用語法except (exc1, exc2) as var可以同時捕獲多種類型的異常。Python 2.6已經支持這兩種語法。
  • 如果兩個對象之間沒有定義明確的有意義的順序。使用<, >, <=, >=比較它們會拋出異常。比如1 < ""在Python 2.6裡面會返回True,而在Python 3.0裡面會拋出異常。現在cmp(), instance.__cmp__()函數已經被刪除。
  • 集合(set)的新寫法:{1,2,3,4}。注意{}仍然表示空的字典(dict)。
  • long類型重命名為int類型,就是說只有一種整數類型,叫做int而表現得更像老式的long
  • 新的str類型表示一個Unicode字符串,相當於Python 2.x版本的unicode類型。而字節序列則用類似b"abc"的語法表示,用bytes類表示,相當於Python 2.x的str類型。現在兩種類型不能再隱式地自動轉換,因此在Python 3.x里"fish" + b"panda"是錯誤的。正確的寫法是"fish" + b"panda".decode("utf-8")。Python 2.6可以自動地將字節序列識別為Unicode字符串,方法是from __future__ import unicode_literals
  • 八進制數必須寫成0o777,原來的形式0777不能用了;二進制必須寫成0b111。新增了一個bin()函數用於將一個整數轉換成二進制字符串。Python 2.6已經支持這兩種語法。
  • dict.keys(), dict.values(), dict.items(), map(), filter(), range(), zip()不再返回列表,而是迭代器。
  • reduce(不涉及mapfilter)從內建名字空間移動至functools,理由是使用reduce的代碼不如使用循環和累加器變量的代碼好讀[12]
  • 多個模塊被改名(根據PEP8):_winreg → winreg,ConfigParser → configparser,copy_reg → copyreg,Queue → queue,SocketServer → socketserver,repr → reprlib。
  • StringIO模塊現在被合併到新的io模塊內。new, md5, gopherlib等模塊被刪除。Python 2.6已經支持新的io模塊。
  • httplib, BaseHTTPServer, CGIHTTPServer, SimpleHTTPServer, Cookie, cookielib被合併到http包內。

版本列表[編輯]

頁面Module:Message box/mbox.css沒有內容。

各階段之版本[編輯]

編號版本之前的版本:

  • 開始實施 - 1989年12月[2]
  • CWI的內部版本 - 1990[2]
版本 最新微版本 發布日期 完全支援結束 安全修復結束
停止支援: 0.9頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 0.9.9[2] 1991-02-20[2] 1993-07-29[a][2]
停止支援: 1.0頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1.0.4[2] 1994-01-26[2] 1994-02-15[a][2]
停止支援: 1.1頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1.1.1[2] 1994-10-11[2] 1994-11-10[a][2]
停止支援: 1.2頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1995-04-13[2] Unsupported
停止支援: 1.3頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1995-10-13[2] Unsupported
停止支援: 1.4頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1996-10-25[2] Unsupported
停止支援: 1.5頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1.5.2[13] 1998-01-03[2] 1999-04-13[a][2]
停止支援: 1.6頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 1.6.1[13] 2000-09-05[14] 2000-09[a][13]
停止支援: 2.0頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.0.1[15] 2000-10-16[16] 2001-06-22[a][15]
停止支援: 2.1頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.1.3[15] 2001-04-15[17] 2002-04-09[a][15]
停止支援: 2.2頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.2.3[15] 2001-12-21[18] 2003-05-30[a][15]
停止支援: 2.3頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.3.7[15] 2003-06-29[19] 2008-03-11[a][15]
停止支援: 2.4頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.4.6[15] 2004-11-30[20] 2008-12-19[a][15]
停止支援: 2.5頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.5.6[15] 2006-09-19[21] 2011-05-26[a][15]
停止支援: 2.6頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.6.9[22] 2008-10-01[22] 2010-08-24[b][22] 2013-10-29[22]
停止支援: 2.7頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 2.7.18[23] 2010-07-03[23] 2020-01-01[c][23]
停止支援: 3.0頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.0.1[15] 2008-12-03[22] 2009-06-27[24]
停止支援: 3.1頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.1.5[25] 2009-06-27[25] 2011-06-12[26] 2012-04-06[25]
停止支援: 3.2頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.2.6[27] 2011-02-20[27] 2013-05-13[b][27] 2016-02-20[27]
停止支援: 3.3頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.3.7[28] 2012-09-29[28] 2014-03-08[b][28] 2017-09-29[28]
停止支援: 3.4頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.4.10[29] 2014-03-16[29] 2017-08-09[30] 2019-03-18[a][29]
停止支援: 3.5頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.5.10[31] 2015-09-13[31] 2017-08-08[32] 2020-09-30[31]
停止支援: 3.6頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.6.15[33] 2016-12-23[33] 2018-12-24[b][33] 2021-12-23[34][33]
停止支援: 3.7頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.7.12[35] 2018-06-27[35] 2020-06-27[b][35] 2023-06-27[35]
支援中: 3.8頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。[需要更新] 3.8.20[36] 2019-10-14[36] 2021-05-03[36] 2024-10-07
支援中: 3.9頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。[需要更新] 3.9.20 2020-10-05[37] 2022-05-17[38] 2025-10[37][38][需要更新]
支援中: 3.10頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.10.15[39] 2021-10-04[39] 2023-04-05[39] 2026-10[39]
支援中: 3.11頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.11.10[40] 2022-10-24[40] 2024-04-02[b][40] 2027-10[40]
最新版本: 3.12頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.12.7[41][需要更新] 2023-10-02[41] 2025-05[41][需要更新] 2028-10[41]
最新預覽: 3.13頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。 3.13.0rc3[42][需要更新] 2024-10-01[42][需要更新] 2026-05[42][需要更新] 2029-10[42]
未來版本: 3.14頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。[需要更新] N/A[43][需要更新] 2025-10-01[43][需要更新] 2027-05[43] 2030-10[43]
圖例:
格式:
支援中
最新版本
最新預覽
未來版本
從未發布
頁面Template:Version/styles.css沒有內容。頁面Template:Version/styles.css沒有內容。

表註:

  1. 1.00 1.01 1.02 1.03 1.04 1.05 1.06 1.07 1.08 1.09 1.10 1.11 Date of last micro release.
  2. 2.0 2.1 2.2 2.3 2.4 2.5 Date of last non security only release.
  3. Official support ended on 2020-01-01, but a final release of the code as it appeared on 2020-01-01 was released on 2020-04-20 as version 2.7.18.[23]

支援[編輯]

<timeline> ImageSize = width:800 height:auto barincrement:20 PlotArea = left:40 right:10 bottom:30 top:10

DateFormat = dd/mm/yyyy Period = from:01/01/1990 till:01/01/2031 TimeAxis = orientation:horizontal

Colors =

 id:in_development  value:rgb(0.76, 0.90, 0.96)  legend:In_development
 id:pre_release     value:rgb(1, 0.82, 0.63)  legend:Pre_release
 id:in_support      value:rgb(0.83, 0.96, 0.71)  legend:In_support
 id:maintenance     value:rgb(1, 0.97, 0.78)  legend:Maintenance
 id:out_of_support  value:rgb(0.99, 0.70, 0.67)  legend:Out_of_support
 id:colgrmaj   value:gray(0.5)
 id:colgrmin   value:gray(0.8)

ScaleMajor = gridcolor:colgrmaj unit:year increment:5 start:01/01/1990 ScaleMinor = gridcolor:colgrmin unit:year increment:1 start:01/01/1990

Define $now = 13/07/2026 LineData=

 at:$now color:red width:0.2

PlotData=

 mark:(line,black)
 width:16
 fontsize:S
 shift:(-6, -4)
 bar:3.14 from:01/10/2025 till:01/10/2030 text:3.14 color:in_development
 bar:3.13 from:01/10/2024 till:01/10/2029 text:3.13 color:pre_release
 bar:3.12 from:02/10/2023 till:01/10/2028 text:3.12 color:in_support
 bar:3.11 from:24/10/2022 till:01/10/2027 text:3.11 color:maintenance
 bar:3.10 from:04/10/2021 till:01/10/2026 text:3.10 color:maintenance
 bar:3.9 from:05/10/2020 till:01/10/2025 text:3.9 color:maintenance 
 bar:3.8 from:14/10/2019 till:01/10/2024 text:3.8 color:maintenance
 bar:3.7 from:27/06/2018 till:06/06/2023 text:3.7 color:out_of_support
 bar:3.6 from:23/12/2016 till:23/12/2021 text:3.6 color:out_of_support
 bar:3.5 from:13/09/2015 till:30/09/2020 text:3.5 color:out_of_support
 bar:3.4 from:16/03/2014 till:18/03/2019 text:3.4 color:out_of_support
 bar:3.3 from:29/09/2012 till:29/09/2017 text:3.3 color:out_of_support
 bar:3.2 from:20/02/2011 till:20/02/2016 text:3.2 color:out_of_support
 bar:3.1 from:27/06/2009 till:01/06/2012 text:3.1 color:out_of_support
 bar:3.0 from:03/12/2008 till:27/06/2009 text:3.0 color:out_of_support
 bar:2.7 from:03/07/2010 till:01/01/2020 text:2.7 color:out_of_support
 bar:2.6 from:01/10/2008 till:29/10/2013 text:2.6 color:out_of_support
 bar:2.5 from:19/09/2006 till:26/05/2011 text:2.5 color:out_of_support
 bar:2.4 from:30/11/2004 till:19/12/2008 text:2.4 color:out_of_support
 bar:2.3 from:29/06/2003 till:11/03/2008 text:2.3 color:out_of_support
 bar:2.2 from:21/12/2001 till:30/05/2003 text:2.2 color:out_of_support
 bar:2.1 from:15/04/2001 till:09/04/2002 text:2.1 color:out_of_support
 bar:2.0 from:16/10/2000 till:22/06/2001 text:2.0 color:out_of_support
 bar:1.6 from:14/04/1999 till:16/10/2000 text:1.6 color:out_of_support
 bar:1.5 from:03/01/1998 till:13/04/1999 text:1.5 color:out_of_support
 bar:1.4 from:25/10/1996 till:03/01/1998 text:1.4 color:out_of_support
 bar:1.3 from:13/10/1995 till:25/10/1996 text:1.3 color:out_of_support
 bar:1.2 from:13/04/1995 till:13/10/1995 text:1.2 color:out_of_support
 bar:1.1 from:11/10/1994 till:13/04/1995 text:1.1 color:out_of_support
 bar:1.0 from:26/01/1994 till:11/10/1994 text:1.0 color:out_of_support
 bar:0.9 from:20/02/1991 till:26/01/1994 text:0.9 color:out_of_support

</timeline>

註釋[編輯]

  1. The Making of Python. Artima Developer. [March 22, 2007]. (原始內容存檔於2016-09-01). 
  2. 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 2.14 2.15 2.16 van Rossum, Guido. A Brief Timeline of Python. 2009-01-20 [2019-11-29]. (原始內容存檔於2011-08-25). 
  3. Why was Python created in the first place?. Python FAQ. [March 22, 2007]. (原始內容存檔於2008-02-23). 
  4. van Rossum, Guido. Origin of BDFL. July 31, 2008 [August 1, 2008]. (原始內容存檔於2012-07-21). 
  5. Python Creator Scripts Inside Google. www.eweek.com. March 7, 2006 [May 13, 2008]. (原始內容存檔於2018-08-09). 
  6. Fairchild, Carlie. Guido van Rossum Stepping Down from Role as Python's Benevolent Dictator For Life. Linux Journal. July 12, 2018 [July 12, 2018]. (原始內容存檔於2019-03-27) (English). 
  7. General Python FAQ — Python 3.8.3 documentation. docs.python.org. [2022-01-29]. (原始內容存檔於2012-10-24). 
  8. Kuchling, Andrew M.; Zadka, Moshe. What's New in Python 2.0. [March 22, 2007]. (原始內容存檔於December 14, 2009). 
  9. Welcome to Python.org. python.org. [December 27, 2016]. (原始內容存檔於2020-06-14). 
  10. van Rossum, Guido. PEP 3000 -- Python 3000. 2006-04-05 [December 27, 2016]. (原始內容存檔於2016-03-03). 
  11. Guido van Rossum. What’s New in Python 3.0. Python Software Foundation. 2009-02-14 [2011-02-22]. (原始內容存檔於2010-12-24) (English). 
  12. van Rossum, Guido. Python 3000 FAQ. artima.com. [2016-12-27]. (原始內容存檔於2020-11-09). 
  13. 13.0 13.1 13.2 Releases | Python.org. [2019-11-29]. (原始內容存檔於2015-12-22). 
  14. Drake, Fred L., Jr. PEP 160 -- Python 1.6 Release Schedule. 2000-07-25 [2019-11-29]. (原始內容存檔於2021-12-06). 
  15. 15.00 15.01 15.02 15.03 15.04 15.05 15.06 15.07 15.08 15.09 15.10 15.11 15.12 Download Python | Python.org. [2019-11-29]. (原始內容存檔於2018-08-08). 
  16. Hylton, Jeremy. PEP 200 -- Python 2.0 Release Schedule. [2019-11-29]. (原始內容存檔於2021-12-06). 
  17. Hylton, Jeremy. PEP 226 -- Python 2.1 Release Schedule. 2000-10-16 [2019-11-29]. (原始內容存檔於2021-12-06). 
  18. Warsaw, Barry; van Rossum, Guido. PEP 251 -- Python 2.2 Release Schedule. 2001-04-17 [2019-11-29]. (原始內容存檔於2021-12-06). 
  19. van Rossum, Guido. PEP 283 -- Python 2.3 Release Schedule. 2002-02-27 [2019-11-29]. (原始內容存檔於2021-12-06). 
  20. Warsaw, Barry; Hettinger, Raymond; Baxter, Anthony. PEP 320 -- Python 2.4 Release Schedule. 2003-07-29 [2019-11-29]. (原始內容存檔於2021-12-06). 
  21. Norwitz, Neal; van Rossum, Guido; Baxter, Anthony. PEP 356 -- Python 2.5 Release Schedule. 2006-02-07 [2019-11-29]. (原始內容存檔於2022-03-06). 
  22. 22.0 22.1 22.2 22.3 22.4 Norwitz, Neal; Warsaw, Barry. PEP 361 -- Python 2.6 and 3.0 Release Schedule. 2006-06-29 [2019-11-29]. (原始內容存檔於2012-10-18). 
  23. 23.0 23.1 23.2 23.3 Peterson, Benjamin. PEP 373 -- Python 2.7 Release Schedule. 2008-11-03 [2020-04-20]. (原始內容存檔於2020-01-13). 
  24. 17. Development Cycle — Python Developer's Guide. [2019-11-29]. (原始內容存檔於2023-01-18). 
  25. 25.0 25.1 25.2 Peterson, Benjamin. PEP 375 -- Python 3.1 Release Schedule. 2009-02-08 [2019-11-29]. (原始內容存檔於2017-12-22). 
  26. Peterson, Benjamin. [RELEASED] Python 3.1.4. python-announce (郵件列表). 2011-06-12 [2019-11-29]. (原始內容存檔於2021-12-06). 
  27. 27.0 27.1 27.2 27.3 Brandl, Georg. PEP 392 -- Python 3.2 Release Schedule. 2009-12-30 [2019-11-29]. (原始內容存檔於2021-12-08). 
  28. 28.0 28.1 28.2 28.3 Brandl, Georg. PEP 398 -- Python 3.3 Release Schedule. 2011-03-23 [2019-11-29]. (原始內容存檔於2022-02-14). 
  29. 29.0 29.1 29.2 Hastings, Larry. PEP 429 -- Python 3.4 Release Schedule. 2012-10-17 [2019-11-29]. (原始內容存檔於2021-12-08). 
  30. Hastings, Larry. [RELEASED] Python 3.4.7 is now available. python-announce (郵件列表). 2017-08-09 [2019-11-29]. (原始內容存檔於2021-12-06). 
  31. 31.0 31.1 31.2 Hastings, Larry. PEP 478 -- Python 3.5 Release Schedule. 2014-09-22 [2020-03-17]. (原始內容存檔於2022-02-14). 
  32. Hastings, Larry. [RELEASED] Python 3.5.4 is now available. python-announce (郵件列表). 2017-08-08 [2019-11-29]. (原始內容存檔於2021-12-06). 
  33. 33.0 33.1 33.2 33.3 Deily, Ned. PEP 494 -- Python 3.6 Release Schedule. 2015-05-30 [2021-07-15]. (原始內容存檔於2022-01-27). 
  34. PEP 494 -- Python 3.6 Release Schedule. Python Developer's Guide. Python Foundation. [20 December 2021]. (原始內容存檔於2022-01-13). 
  35. 35.0 35.1 35.2 35.3 Deily, Ned. PEP 537 -- Python 3.7 Release Schedule. 2016-12-23 [2021-07-15]. (原始內容存檔於2018-07-12). 
  36. 36.0 36.1 36.2 Langa, Łukasz. PEP 569 -- Python 3.8 Release Schedule. 2018-01-27 [2021-07-15]. (原始內容存檔於2022-02-14). 
  37. 37.0 37.1 Langa, Łukasz. PEP 596 -- Python 3.9 Release Schedule. 2020-10-13 [2021-07-15]. (原始內容存檔於2020-06-04). 
  38. 38.0 38.1 Langa, Łukasz. PEP 602 -- Annual Release Cycle for Python. 2019-06-04 [2019-11-29]. (原始內容存檔於2020-06-14). 
  39. 39.0 39.1 39.2 39.3 Salgado, Pablo. PEP 619 -- Python 3.10 Release Schedule. 2020-05-25 [2021-07-15]. (原始內容存檔於2022-02-13). 
  40. 40.0 40.1 40.2 40.3 Salgado, Pablo. PEP 664 -- Python 3.11 Release Schedule. 2021-07-12 [2021-07-15]. (原始內容存檔於2022-03-07). 
  41. 41.0 41.1 41.2 41.3 Wouters, Thomas. PEP 693 – Python 3.12 Release Schedule. 2022-05-24 [2023-07-16]. (原始內容存檔於July 16, 2023). 
  42. 42.0 42.1 42.2 42.3 Wouters, Thomas. PEP 719 -- Python 3.13 Release Schedule. 2023-05-26 [2023-07-16]. (原始內容存檔於2023-07-16). 
  43. 43.0 43.1 43.2 43.3 van Kemenade, Hugo. PEP 745 – Python 3.14 Release Schedule | peps.python.org. Python Enhancement Proposals (PEPs). 24 April 2024 [15 May 2024]. (原始內容存檔於5 May 2024) (English). 

參閲[編輯]

外部連結[編輯]