旧Python标识,1990年代–2006年
新Python标识,2006年–目前
主条目:Python
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(不涉及map或filter)从内置命名空间移动至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包内。
版本列表[编辑]
此条目或章节需要时常更新。有关事物或许会随着时间而有所变化。未有可靠来源的臆测内容可能会被移除。若您发现有尚未更新之处,欢迎您编辑更新。
各阶段之版本[编辑]
编号版本之前的版本:
开始实施 - 1989年12月[2]
CWI的内部版本 - 1990[2]
版本
最新微版本
发布日期
完全支持结束
安全修复结束
旧版本,不再支持: 0.9
0.9.9[2]
1991-02-20[2]
1993-07-29[a][2]
旧版本,不再支持: 1.0
1.0.4[2]
1994-01-26[2]
1994-02-15[a][2]
旧版本,不再支持: 1.1
1.1.1[2]
1994-10-11[2]
1994-11-10[a][2]
旧版本,不再支持: 1.2
1995-04-13[2]
Unsupported
旧版本,不再支持: 1.3
1995-10-13[2]
Unsupported
旧版本,不再支持: 1.4
1996-10-25[2]
Unsupported
旧版本,不再支持: 1.5
1.5.2[13]
1998-01-03[2]
1999-04-13[a][2]
旧版本,不再支持: 1.6
1.6.1[13]
2000-09-05[14]
2000-09[a][13]
旧版本,不再支持: 2.0
2.0.1[15]
2000-10-16[16]
2001-06-22[a][15]
旧版本,不再支持: 2.1
2.1.3[15]
2001-04-15[17]
2002-04-09[a][15]
旧版本,不再支持: 2.2
2.2.3[15]
2001-12-21[18]
2003-05-30[a][15]
旧版本,不再支持: 2.3
2.3.7[15]
2003-06-29[19]
2008-03-11[a][15]
旧版本,不再支持: 2.4
2.4.6[15]
2004-11-30[20]
2008-12-19[a][15]
旧版本,不再支持: 2.5
2.5.6[15]
2006-09-19[21]
2011-05-26[a][15]
旧版本,不再支持: 2.6
2.6.9[22]
2008-10-01[22]
2010-08-24[b][22]
2013-10-29[22]
旧版本,不再支持: 2.7
2.7.18[23]
2010-07-03[23]
2020-01-01[c][23]
旧版本,不再支持: 3.0
3.0.1[15]
2008-12-03[22]
2009-06-27[24]
旧版本,不再支持: 3.1
3.1.5[25]
2009-06-27[25]
2011-06-12[26]
2012-04-06[25]
旧版本,不再支持: 3.2
3.2.6[27]
2011-02-20[27]
2013-05-13[b][27]
2016-02-20[27]
旧版本,不再支持: 3.3
3.3.7[28]
2012-09-29[28]
2014-03-08[b][28]
2017-09-29[28]
旧版本,不再支持: 3.4
3.4.10[29]
2014-03-16[29]
2017-08-09[30]
2019-03-18[a][29]
旧版本,不再支持: 3.5
3.5.10[31]
2015-09-13[31]
2017-08-08[32]
2020-09-30[31]
旧版本,不再支持: 3.6
3.6.15[33]
2016-12-23[33]
2018-12-24[b][33]
2021-12-23[34][33]
旧版本,不再支持: 3.7
3.7.12[35]
2018-06-27[35]
2020-06-27[b][35]
2023-06-27[35]
旧版本,仍被支持: 3.8[需要更新]
3.8.20[36]
2019-10-14[36]
2021-05-03[36]
2024-10-07
旧版本,仍被支持: 3.9
3.9.20
2020-10-05[37]
2022-05-17[38]
2025-10[37][38]
旧版本,仍被支持: 3.10
3.10.15[39]
2021-10-04[39]
2023-04-05[39]
2026-10[39]
旧版本,仍被支持: 3.11
3.11.10[40]
2022-10-24[40]
2024-04-02[b][40]
2027-10[40]
当前版本: 3.12
3.12.7[41][需要更新]
2023-10-02[41]
2025-05[41][需要更新]
2028-10[41]
最新预览版本: 3.13
3.13.0rc3[42][需要更新]
2024-10-01[42][需要更新]
2026-05[42]
2029-10[42]
未来版本: 3.14[需要更新]
N/A[43][需要更新]
2025-10-01[43]
2027-05[43]
2030-10[43]
图例:
格式:旧版本旧版本,仍被支持当前版本最新的预览版未来版本
表注:
^ 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.0 2.1 2.2 2.3 2.4 2.5 Date of last non security only release.
^ 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]
支持[编辑]
注释[编辑]
^ The Making of Python. Artima Developer. [March 22, 2007]. (原始内容存档于2016-09-01).
^ 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).
^ Why was Python created in the first place?. Python FAQ. [March 22, 2007]. (原始内容存档于2008-02-23).
^ van Rossum, Guido. Origin of BDFL. July 31, 2008 [August 1, 2008]. (原始内容存档于2012-07-21).
^ Python Creator Scripts Inside Google. www.eweek.com. March 7, 2006 [May 13, 2008]. (原始内容存档于2018-08-09).
^ 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) (英语).
^ General Python FAQ — Python 3.8.3 documentation. docs.python.org. [2022-01-29]. (原始内容存档于2012-10-24).
^ Kuchling, Andrew M.; Zadka, Moshe. What's New in Python 2.0. [March 22, 2007]. (原始内容存档于December 14, 2009).
^ Welcome to Python.org. python.org. [December 27, 2016]. (原始内容存档于2020-06-14).
^ van Rossum, Guido. PEP 3000 -- Python 3000. 2006-04-05 [December 27, 2016]. (原始内容存档于2016-03-03).
^ Guido van Rossum. What’s New in Python 3.0. Python Software Foundation. 2009-02-14 [2011-02-22]. (原始内容存档于2010-12-24) (英语).
^ van Rossum, Guido. Python 3000 FAQ. artima.com. [2016-12-27]. (原始内容存档于2020-11-09).
^ 13.0 13.1 13.2 Releases | Python.org. [2019-11-29]. (原始内容存档于2015-12-22).
^ Drake, Fred L., Jr. PEP 160 -- Python 1.6 Release Schedule. 2000-07-25 [2019-11-29]. (原始内容存档于2021-12-06).
^ 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).
^ Hylton, Jeremy. PEP 200 -- Python 2.0 Release Schedule. [2019-11-29]. (原始内容存档于2021-12-06).
^ Hylton, Jeremy. PEP 226 -- Python 2.1 Release Schedule. 2000-10-16 [2019-11-29]. (原始内容存档于2021-12-06).
^ Warsaw, Barry; van Rossum, Guido. PEP 251 -- Python 2.2 Release Schedule. 2001-04-17 [2019-11-29]. (原始内容存档于2021-12-06).
^ van Rossum, Guido. PEP 283 -- Python 2.3 Release Schedule. 2002-02-27 [2019-11-29]. (原始内容存档于2021-12-06).
^ Warsaw, Barry; Hettinger, Raymond; Baxter, Anthony. PEP 320 -- Python 2.4 Release Schedule. 2003-07-29 [2019-11-29]. (原始内容存档于2021-12-06).
^ Norwitz, Neal; van Rossum, Guido; Baxter, Anthony. PEP 356 -- Python 2.5 Release Schedule. 2006-02-07 [2019-11-29]. (原始内容存档于2022-03-06).
^ 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.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).
^ 17. Development Cycle — Python Developer's Guide. [2019-11-29]. (原始内容存档于2023-01-18).
^ 25.0 25.1 25.2 Peterson, Benjamin. PEP 375 -- Python 3.1 Release Schedule. 2009-02-08 [2019-11-29]. (原始内容存档于2017-12-22).
^ Peterson, Benjamin. [RELEASED] Python 3.1.4. python-announce (邮件列表). 2011-06-12 [2019-11-29]. (原始内容存档于2021-12-06).
^ 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.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.0 29.1 29.2 Hastings, Larry. PEP 429 -- Python 3.4 Release Schedule. 2012-10-17 [2019-11-29]. (原始内容存档于2021-12-08).
^ Hastings, Larry. [RELEASED] Python 3.4.7 is now available. python-announce (邮件列表). 2017-08-09 [2019-11-29]. (原始内容存档于2021-12-06).
^ 31.0 31.1 31.2 Hastings, Larry. PEP 478 -- Python 3.5 Release Schedule. 2014-09-22 [2020-03-17]. (原始内容存档于2022-02-14).
^ Hastings, Larry. [RELEASED] Python 3.5.4 is now available. python-announce (邮件列表). 2017-08-08 [2019-11-29]. (原始内容存档于2021-12-06).
^ 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).
^ PEP 494 -- Python 3.6 Release Schedule. Python Developer's Guide. Python Foundation. [20 December 2021]. (原始内容存档于2022-01-13).
^ 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.0 36.1 36.2 Langa, Łukasz. PEP 569 -- Python 3.8 Release Schedule. 2018-01-27 [2021-07-15]. (原始内容存档于2022-02-14).
^ 37.0 37.1 Langa, Łukasz. PEP 596 -- Python 3.9 Release Schedule. 2020-10-13 [2021-07-15]. (原始内容存档于2020-06-04).
^ 38.0 38.1 Langa, Łukasz. PEP 602 -- Annual Release Cycle for Python. 2019-06-04 [2019-11-29]. (原始内容存档于2020-06-14).
^ 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.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.0 41.1 41.2 41.3 引用错误:没有为名为pep-0693的参考文献提供内容
^ 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.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) (英语).
参阅[编辑]
软件工程史(英语:History of software engineering)
阿米巴操作系统(英语:Amoeba (operating system))(Amoeba/阿米巴操作系统)
Python语法及语义
外部链接[编辑]
Guido Van Rossum blog on Python's History (页面存档备份,存于互联网档案馆)