Python

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

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

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

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

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

  1. ^ 引用错误:没有为名为release的参考文献提供内容
  2. ^ "Python 3.13.5 is now available!"; 作者姓名字符串: Thomas Wouters; 出版日期: 2025年6月11日; 检索日期: 2025年6月11日.
  3. ^ "Python 3.14.0 beta 3 is here!"; 作者姓名字符串: Hugo; 出版日期: 2025年6月17日; 检索日期: 2025年6月20日.
  4. ^ 引用错误:没有为名为duck的参考文献提供内容
  5. ^ Why is Python a dynamic language and also a strongly typed language - Python Wiki. wiki.python.org. [2021-01-27]. (原始内容存档于2021-03-14). 
  6. ^ 引用错误:没有为名为pep483的参考文献提供内容
  7. ^ File extension .pyo was removed in Python 3.5. See PEP 0488页面存档备份,存于互联网档案馆
  8. ^ Holth, Moore. PEP 0441 -- Improving Python ZIP Application Support. 2014-03-30 [2015-11-12]. (原始内容存档于2018-12-26). 
  9. ^ 引用错误:没有为名为faq-created的参考文献提供内容
  10. ^ Andrew Kuchling, Guido van Rossum. LJ Interviews Guido van Rossum. 1998-11-01 [2023-03-21]. (原始内容存档于2023-03-30). String slicing came from Algol-68 and Icon. 
  11. ^ 11.0 11.1 The Python Standard Library - Functional Programming Modules - itertools — Functions creating iterators for efficient looping. [2020-04-22]. (原始内容存档于2020-06-14). 
  12. ^ 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. 
  13. ^ 13.0 13.1 The Python Tutorial - 9. Classes. [2012-02-20]. (原始内容存档于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. 
  14. ^ 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. 
  15. ^ 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. 
  16. ^ Kuchling, A. M. Functional Programming HOWTO. Python v2.7.2 documentation. Python Software Foundation. [2012-02-09]. (原始内容存档于2012-10-24). 
  17. ^ 17.0 17.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.
     
  18. ^ Smith, Kevin D.; Jewett, Jim J.; Montanaro, Skip; Baxter, Anthony. PEP 318 – Decorators for Functions and Methods. Python Enhancement Proposals. Python Software Foundation. 2004-09-02 [2012-02-24]. (原始内容存档于2020-06-03). 
  19. ^ More Control Flow Tools. Python 3 documentation. Python Software Foundation. [2015-07-24]. (原始内容存档于2016-06-04). 
  20. ^ 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. 
  21. ^ 引用错误:没有为名为Boo的参考文献提供内容
  22. ^ 引用错误:没有为名为Cobra的参考文献提供内容
  23. ^ CoffeeScript for Python Programmers. CoffeeScript is a programming language whose syntax is clearly designed to match much of Python (with additional inspirations from Perl, ECMAScript, Ruby, etc.). 
  24. ^ 引用错误:没有为名为gdscript的参考文献提供内容
  25. ^ 引用错误:没有为名为go的参考文献提供内容
  26. ^ 引用错误:没有为名为Groovy的参考文献提供内容
  27. ^ Perl and Python influences in JavaScript. www.2ality.com. 2013-02-24 [2015-05-15]. (原始内容存档于2018-12-26). 
  28. ^ Rauschmayer, Axel. Chapter 3: The Nature of JavaScript; Influences. O'Reilly, Speaking JavaScript. [2015-05-15]. (原始内容存档于2018-12-26). 
  29. ^ 引用错误:没有为名为Julia的参考文献提供内容
  30. ^ 引用错误:没有为名为Kotlin的参考文献提供内容
  31. ^ Krill, Paul. Mojo language marries Python and MLIR for AI development. InfoWorld. 2023-05-04 [2023-05-05]. (原始内容存档于2023-05-05) (英语). 
  32. ^ 引用错误:没有为名为Nim的参考文献提供内容
  33. ^ 引用错误:没有为名为bini的参考文献提供内容
  34. ^ 引用错误:没有为名为starlark的参考文献提供内容
  35. ^ Lattner, Chris. Chris Lattner's Homepage. Chris Lattner. 2014-06-03 [2014-06-03]. (原始内容存档于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. 
  36. ^ 彼德·諾米格. 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). 
  37. ^ Rossum, Guido Van. The History of Python: A Brief Timeline of Python. The History of Python. 2009-01-20 [2021-03-05]. (原始内容存档于2020-06-05). 
  38. ^ Peterson, Benjamin. Python Insider: Python 2.7.18, the last release of Python 2. Python Insider. 2020-04-20 [2020-04-27]. (原始内容存档于2020-04-26). 
  39. ^ Stack Overflow Developer Survey 2024. JavaScript, Python and SQL are all highly-desired and admired programming languages 
  40. ^ the State of Developer Ecosystem Report 2024. 
  41. ^ 引用错误:没有为名为tiobe-index的参考文献提供内容
  42. ^ PYPL PopularitY of Programming Language index. pypl.github.io. [2021-03-26]. (原始内容存档于2017-03-14) (英语). 

From Wikipedia, the free encyclopedia · View on Wikipedia

Developed by Nelliwinne