Python(英式發音:/ˈpaɪθən/;美式發音:/ˈpaɪθɑːn/),是一种广泛使用的解释型、高级和通用的编程语言。Python支持多种编程范型,包括结构化、过程式、反射式、面向对象和函数式编程。它拥有动态类型系统和垃圾回收功能,能够自动管理内存使用,并且其本身拥有一个巨大而广泛的标准库。它的语言结构以及面向对象的方法,旨在帮助程序员为小型的和大型的项目编写逻辑清晰的代码。
吉多·范罗苏姆于1980年代后期开始研发Python,作为ABC语言的后继者[20],它也可以被视为采用了叫做M-表达式的中缀表示法的一种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]。
- ^ 引用错误:没有为名为
release
的参考文献提供内容
- ^ "Python 3.13 released"; 检索日期: 2024年10月7日; 作品或名稱使用語言: 英語; 出版日期: 2024年10月7日; 宣传物: LWN.net.
- ^ Python 3.13.0 (final) released. 2024年10月7日 [2024年10月8日] (英語).
- ^ "Python 3.13 Debuts With New Interactive Interpreter & Experimental JIT"; 检索日期: 2024年10月8日; 作品或名稱使用語言: 英語; 出版日期: 2024年10月7日; 宣传物: Phoronix.
- ^ "Python 3.14 Alpha 1 Released With Early Changes"; 检索日期: 2024年10月16日; 作品或名稱使用語言: 英語; 出版日期: 2024年10月15日; 宣传物: Phoronix.
- ^ Python 3.14.0 alpha 1 is now available. 2024年10月15日 [2024年10月16日] (英語).
- ^ 引用错误:没有为名为
duck
的参考文献提供内容
- ^
Why is Python a dynamic language and also a strongly typed language - Python Wiki. wiki.python.org. [2021-01-27]. (原始内容存档于2021-03-14).
- ^ 引用错误:没有为名为
pep483
的参考文献提供内容
- ^ File extension .pyo was removed in Python 3.5. See PEP 0488 (页面存档备份,存于互联网档案馆)
- ^ Holth, Moore. PEP 0441 -- Improving Python ZIP Application Support. 2014-03-30 [2015-11-12]. (原始内容存档于2018-12-26).
- ^ 引用错误:没有为名为
faq-created
的参考文献提供内容
- ^ 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.0 14.1
The Python Standard Library - Functional Programming Modules - itertools — Functions creating iterators for efficient looping. [2020-04-22]. (原始内容存档于2020-06-14).
- ^
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.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.
- ^ 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.
- ^
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.
- ^
Kuchling, A. M. Functional Programming HOWTO. Python v2.7.2 documentation. Python Software Foundation. [9 February 2012]. (原始内容存档于2012-10-24).
- ^ 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 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.
- ^
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).
- ^
More Control Flow Tools. Python 3 documentation. Python Software Foundation. [24 July 2015]. (原始内容存档于2016-06-04).
- ^ 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.
- ^
CoffeeScript. coffeescript.org. [2021-03-14]. (原始内容存档于2020-06-12).
- ^ 引用错误:没有为名为
gdscript
的参考文献提供内容
- ^
The Genie Programming Language Tutorial. [28 February 2020]. (原始内容存档于2020-06-01).
- ^ 引用错误:没有为名为
go
的参考文献提供内容
- ^
Perl and Python influences in JavaScript. www.2ality.com. 24 February 2013 [15 May 2015]. (原始内容存档于2018-12-26).
- ^ Rauschmayer, Axel. Chapter 3: The Nature of JavaScript; Influences. O'Reilly, Speaking JavaScript. [15 May 2015]. (原始内容存档于2018-12-26).
- ^ 引用错误:没有为名为
Julia
的参考文献提供内容
- ^ Krill, Paul. Mojo language marries Python and MLIR for AI development. InfoWorld. 2023-05-04 [2023-05-05]. (原始内容存档于5 May 2023) (英语).
- ^ 引用错误:没有为名为
bini
的参考文献提供内容
- ^ 引用错误:没有为名为
starlark
的参考文献提供内容
- ^
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.
- ^ 彼德·諾米格. 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).
- ^ 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).
- ^ 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).
- ^ Stack Overflow Developer Survey 2020. Stack Overflow. [2021-03-05]. (原始内容存档于2 March 2021).
- ^ The State of Developer Ecosystem in 2020 Infographic. JetBrains: Developer Tools for Professionals and Teams. [2021-03-05]. (原始内容存档于1 March 2021) (英语).
- ^ 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.
- ^ PYPL PopularitY of Programming Language index. pypl.github.io. [2021-03-26]. (原始内容存档于14 March 2017) (英语).