Python

Python
编程范型多范型过程式结构化模块化反射式面向对象函数式
設計者吉多·范罗苏姆
實作者Python软件基金会
发行时间1991年​(1991[1]
当前版本
  • 3.13.0(2024年10月7日;穩定版本)[2][3][4]
  • 3.14.0a1(2024年10月15日;預覽版本)[5][6]
編輯維基數據鏈接
型態系統鸭子类型[7]动态强类型[8]渐进英语gradual typing(自从3.5)[9]
操作系统跨平臺
許可證Python软件基金会许可证
文件扩展名.py、.pyi、.pyc、.pyd、.pyo(3.5之前)[10]、.pyw、.pyz(自从3.5)[11]
網站www.python.org 編輯維基數據鏈接
主要實作產品
CPythonPyPyStackless PythonMicroPythonCircuitPython英语CircuitPythonIronPythonJython
衍生副語言
CythonRPython
啟發語言
ABC[12]ALGOL 68[13]APL[14]C[15]C++[16]CLU[17]Dylan[18]Haskell[19]Icon[20]Java[21]Lisp[22]Modula-3[16]Perl[23]Standard ML[14]
影響語言
BooCobra英语Cobra (programming language)CoffeeScript[24]DF#GDScript[25]Genie[26]Go[27]GroovyJavaScript[28][29]Julia[30]Mojo[31]NimRuby[32]Starlark英语Bazel (software)#Starlark language[33]Swift[34]

Python英式發音:/ˈpaɪθən/美式發音:/ˈpaɪθɑːn/),是一种广泛使用的解释型高级通用编程语言。Python支持多种编程范型,包括结构化、过程式、反射式、面向对象和函数式编程。它拥有动态类型系统垃圾回收功能,能够自动管理内存使用,并且其本身拥有一个巨大而广泛的标准库。它的语言结构以及面向对象的方法,旨在帮助程序员为小型的和大型的项目编写逻辑清晰的代码。

吉多·范罗苏姆于1980年代后期开始研发Python,作为ABC语言的后继者[20],它也可以被视为采用了叫做M-表达式英语M-expression中缀表示法的一种LISP方言[35]吉多·范罗苏姆于1991年首次发布 Python 0.9.0[36]。Python 2.0于2000 年发布并引入了新功能。Python 3.0于2008年发布,它是该语言的主要修订版,并非完全向后兼容。Python 2于2020年随2.7.18版停止支持[37]

Python的设计哲学,强调代码的可读性和简洁的语法,尤其是使用空格缩进来划分代码块。相比於C语言或Java,Python让开发者能够用更少的代码表达想法。

Python解释器本身几乎可以在所有的操作系统中运行,它的官方直譯器CPython是用C语言编写的。Python是一個由社群驱动的自由软件,目前由Python软件基金会管理。Python是最受欢迎的编程语言之一[38][39][40][41]

  1. ^ 引用错误:没有为名为release的参考文献提供内容
  2. ^ "Python 3.13 released"; 检索日期: 2024年10月7日; 作品或名稱使用語言: 英語; 出版日期: 2024年10月7日; 宣传物: LWN.net.
  3. ^ Python 3.13.0 (final) released. 2024年10月7日 [2024年10月8日] (英語). 
  4. ^ "Python 3.13 Debuts With New Interactive Interpreter & Experimental JIT"; 检索日期: 2024年10月8日; 作品或名稱使用語言: 英語; 出版日期: 2024年10月7日; 宣传物: Phoronix.
  5. ^ "Python 3.14 Alpha 1 Released With Early Changes"; 检索日期: 2024年10月16日; 作品或名稱使用語言: 英語; 出版日期: 2024年10月15日; 宣传物: Phoronix.
  6. ^ Python 3.14.0 alpha 1 is now available. 2024年10月15日 [2024年10月16日] (英語). 
  7. ^ 引用错误:没有为名为duck的参考文献提供内容
  8. ^ Why is Python a dynamic language and also a strongly typed language - Python Wiki. wiki.python.org. [2021-01-27]. (原始内容存档于2021-03-14). 
  9. ^ 引用错误:没有为名为pep483的参考文献提供内容
  10. ^ File extension .pyo was removed in Python 3.5. See PEP 0488页面存档备份,存于互联网档案馆
  11. ^ Holth, Moore. PEP 0441 -- Improving Python ZIP Application Support. 2014-03-30 [2015-11-12]. (原始内容存档于2018-12-26). 
  12. ^ 引用错误:没有为名为faq-created的参考文献提供内容
  13. ^ Andrew Kuchling, Guido van Rossum. LJ Interviews Guido van Rossum. November 1, 1998 [2023-03-21]. (原始内容存档于2023-03-30). String slicing came from Algol-68 and Icon. 
  14. ^ 14.0 14.1 The Python Standard Library - Functional Programming Modules - itertools — Functions creating iterators for efficient looping. [2020-04-22]. (原始内容存档于2020-06-14). 
  15. ^ van Rossum, Guido. An Introduction to Python for UNIX/C Programmers. Proceedings of the NLUUG Najaarsconferentie (Dutch UNIX Users Group). 1993 [2021-03-14]. (原始内容存档于2013-06-17). even though the design of C is far from ideal, its influence on Python is considerable. 
  16. ^ 16.0 16.1 The Python Tutorial - 9. Classes. [20 February 2012]. (原始内容存档于2012-10-23). Compared with other programming languages, Python’s class mechanism adds classes with a minimum of new syntax and semantics. It is a mixture of the class mechanisms found in C++ and Modula-3. 
  17. ^ Fredrik Lundh. Python-list mailing list - passing by refference. [2023-03-06]. (原始内容存档于2023-03-06). replace "CLU" with "Python", "record" with "instance", and "procedure" with "function or method", and you get a pretty accurate description of Python's object model. 
  18. ^ Simionato, Michele. The Python 2.3 Method Resolution Order. Python Software Foundation. [2021-03-14]. (原始内容存档于2020-08-20). The C3 method itself has nothing to do with Python, since it was invented by people working on Dylan and it is described in a paper intended for lispers. 
  19. ^ Kuchling, A. M. Functional Programming HOWTO. Python v2.7.2 documentation. Python Software Foundation. [9 February 2012]. (原始内容存档于2012-10-24). 
  20. ^ 20.0 20.1 Guido van Rossum. Python Reference Manual - Version 1.2 (PDF). CWI Report CS-R9525. May 1995 [2023-03-04]. (原始内容存档 (PDF)于2023-03-05). Python is a simple, yet powerful, interpreted programming language that bridges the gap between C and shell programming, and is thus ideally suited for "throw-away英语Software_prototyping#Throwaway_prototyping programming" and rapid prototyping. Its syntax is put together from constructs borrowed from a variety of other languages; most prominent are influences from ABC, C, Modula-3 and Icon.
    The Python interpreter is easily extended with new functions and data types implemented in C. Python is also suitable as an extension language for highly customizable C applications such as editors or window managers.
     
  21. ^ Smith, Kevin D.; Jewett, Jim J.; Montanaro, Skip; Baxter, Anthony. PEP 318 – Decorators for Functions and Methods. Python Enhancement Proposals. Python Software Foundation. 2 September 2004 [24 February 2012]. (原始内容存档于2020-06-03). 
  22. ^ More Control Flow Tools. Python 3 documentation. Python Software Foundation. [24 July 2015]. (原始内容存档于2016-06-04). 
  23. ^ re — Regular expression operations. docs.python.org. [2022-09-06]. (原始内容存档于2018-07-18). This module provides regular expression matching operations similar to those found in Perl. 
  24. ^ CoffeeScript. coffeescript.org. [2021-03-14]. (原始内容存档于2020-06-12). 
  25. ^ 引用错误:没有为名为gdscript的参考文献提供内容
  26. ^ The Genie Programming Language Tutorial. [28 February 2020]. (原始内容存档于2020-06-01). 
  27. ^ 引用错误:没有为名为go的参考文献提供内容
  28. ^ Perl and Python influences in JavaScript. www.2ality.com. 24 February 2013 [15 May 2015]. (原始内容存档于2018-12-26). 
  29. ^ Rauschmayer, Axel. Chapter 3: The Nature of JavaScript; Influences. O'Reilly, Speaking JavaScript. [15 May 2015]. (原始内容存档于2018-12-26). 
  30. ^ 引用错误:没有为名为Julia的参考文献提供内容
  31. ^ Krill, Paul. Mojo language marries Python and MLIR for AI development. InfoWorld. 2023-05-04 [2023-05-05]. (原始内容存档于5 May 2023) (英语). 
  32. ^ 引用错误:没有为名为bini的参考文献提供内容
  33. ^ 引用错误:没有为名为starlark的参考文献提供内容
  34. ^ Lattner, Chris. Chris Lattner's Homepage. Chris Lattner. 3 June 2014 [3 June 2014]. (原始内容存档于2018-12-25). Of course, it also greatly benefited from the experiences hard-won by many other languages in the field, drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list. 
  35. ^ 彼德·諾米格. Python for Lisp Programmers. [2020-04-21]. (原始内容存档于2020-06-14). Python can be seen as a dialect of Lisp with "traditional" syntax (what Lisp people call "infix" or "m-lisp" syntax). 
  36. ^ Rossum, Guido Van. The History of Python: A Brief Timeline of Python. The History of Python. 2009-01-20 [2021-03-05]. (原始内容存档于5 June 2020). 
  37. ^ Peterson, Benjamin. Python Insider: Python 2.7.18, the last release of Python 2. Python Insider. 20 April 2020 [27 April 2020]. (原始内容存档于26 April 2020). 
  38. ^ Stack Overflow Developer Survey 2020. Stack Overflow. [2021-03-05]. (原始内容存档于2 March 2021). 
  39. ^ The State of Developer Ecosystem in 2020 Infographic. JetBrains: Developer Tools for Professionals and Teams. [2021-03-05]. (原始内容存档于1 March 2021) (英语). 
  40. ^ index | TIOBE - The Software Quality Company. www.tiobe.com. [2021-02-02]. (原始内容存档于25 February 2018). Python has won the TIOBE programming language of the year award! This is for the fourth time in the history, which is a record! The title is awarded to the programming language that has gained most popularity in one year. 
  41. ^ PYPL PopularitY of Programming Language index. pypl.github.io. [2021-03-26]. (原始内容存档于14 March 2017) (英语). 

Developed by StudentB