Python (programming language): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Reverting edit(s) by Handedits (talk) to rev. 1226126303 by Magioladitis: Reverting good faith edits: the grammar was better before (RW 16.1)
 
Line 1: Line 1:
{{infobox programming language
{{Short description|General-purpose programming language}}
{{Use dmy dates|date=November 2021}}
| name = Python
{{Infobox programming language
| logo = [[Image:Python logo.svg|300px]]
| logo = Python-logo-notext.svg
| paradigm = [[Multi-paradigm programming language|multi-paradigm]]: [[Object-oriented programming|object-oriented]], [[Imperative programming|imperative]], [[Functional programming|functional]]
| logo size = 121px
| year = [[1991]]
| paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[Object-oriented programming|object-oriented]],<ref>{{Cite web|title=General Python FAQ – Python 3.9.2 documentation|url=https://docs.python.org/3/faq/general.html#what-is-python|access-date=2021-03-28|website=docs.python.org|archive-date=24 October 2012|archive-url=https://web.archive.org/web/20121024164224/http://docs.python.org/faq/general.html#what-is-python|url-status=live}}</ref> [[Procedural programming|procedural]] ([[Imperative programming|imperative]]), [[Functional programming|functional]], [[Structured programming|structured]], [[Reflective programming|reflective]]
| designer = [[Guido van Rossum]]
| released = {{start date and age|1991|02|20|df=y}}<ref name="alt-sources-history">{{cite web |url=https://www.tuhs.org/Usenet/alt.sources/1991-February/001749.html |title=Python 0.9.1 part 01/21 |publisher=alt.sources archives |access-date=2021-08-11 |archive-date=11 August 2021 |archive-url=https://web.archive.org/web/20210811171015/https://www.tuhs.org/Usenet/alt.sources/1991-February/001749.html |url-status=live}}</ref>
| developer = [[Python Software Foundation]]
| designer = [[Guido van Rossum]]
| latest_release_version = 2.5.2
| developer = [[Python Software Foundation]]
| latest_release_date = {{release date|2008|2|21}}
| latest release version = {{wikidata|property|edit|P548=Q2804309|P348}}
| latest_test_version = 2.6rc2 and 3.0rc1
| latest release date = {{start date and age|{{wikidata|qualifier|single|P548=Q2804309|P348|P577}}}}
| latest_test_date = {{release date|2008|9|17}} and {{release date|2008|9|17}}
| latest preview version = {{wikidata|property|edit|reference|P548=Q51930650|P348}}
| typing = [[strong typing|strong]], [[dynamic typing|dynamic]], [[duck typing|duck]]
| latest preview date = {{start date and age|{{wikidata|qualifier|single|P548=Q51930650|P348|P577}}}}
| implementations = [[CPython]], [[Jython]], [[IronPython]], [[PyPy]]
| typing = [[Duck typing|duck]], [[Dynamic typing|dynamic]], [[Strong and weak typing|strong]];<ref>{{Cite web|title=Why is Python a dynamic language and also a strongly typed language |url=https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language|access-date=2021-01-27|website=Python Wiki |archive-date=14 March 2021|archive-url=https://web.archive.org/web/20210314173706/https://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language|url-status=live}}</ref> [[Optional typing|optional type annotations]] (since 3.5, but those hints are ignored, except with unofficial tools)<ref name="type_hint-PEP">{{cite web|url=https://www.python.org/dev/peps/pep-0483/|title=PEP 483 – The Theory of Type Hints|website=Python.org|access-date=14 June 2018|archive-date=14 June 2020|archive-url=https://web.archive.org/web/20200614153558/https://www.python.org/dev/peps/pep-0483/|url-status=live}}</ref>
| dialects = [[Stackless Python]], [[RPython]]
| implementations = [[CPython]], [[PyPy]], [[Stackless Python]], [[MicroPython]], [[CircuitPython]], [[IronPython]], [[Jython]]
| influenced_by = [[ABC programming language|ABC]], [[ALGOL 68]],<ref>{{cite web |url=http://www.amk.ca/python/writing/gvr-interview |title=Interview with Guido van Rossum|year=1998 |month=July |accessmonthday=29 |accessyear=2007}}</ref> [[C (programming language)|C]], [[Haskell (programming language)|Haskell]], [[Icon programming language|Icon]], [[Lisp programming language|Lisp]], [[Modula-3]], [[Perl]], [[Java (programming language)|Java]]
| operating system = '''Tier 1''': 64-bit [[Linux]], [[macOS]]; 64- and 32-bit [[Windows]] 10+<ref>{{Cite web |title=PEP 11 – CPython platform support {{!}} peps.python.org |url=https://peps.python.org/pep-0011/ |access-date=2024-04-22 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref><!-- Not "Windows for IoT and embedded systems"; NOT UNIX, it's not listed, nor any Unix-like, maybe implied --><br >'''Tier 2''': E.g. 32-bit [[WebAssembly]] (WASI) <!-- (WASI SDK, Wasmtime) meaning wasm32-unknown-wasi; wasm32-unknown-emscripten is unsupported since 3.13. also aarch64-unknown-linux-gnu (.. glibc, clang) so does that imply Android? At least Android is not in tier 1. aarch64-pc-windows-msvc and powerpc64le-unknown-linux-gnu -->'''Tier 3''': 64-bit [[FreeBSD]], [[iOS]]; e.g. [[Raspberry Pi OS]]<br >Unofficial (or has been known to work): Other [[Unix-like]]/[[Berkeley Software Distribution|BSD]] variants and e.g. [[Android (operating system)|Android]] 5.0+ (official from Python 3.13 planned<ref>{{Cite web |title=PEP 738 – Adding Android as a supported platform {{!}} peps.python.org |url=https://peps.python.org/pep-0738/ |access-date=2024-05-19 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref>) and a few other platforms<!-- used to support many, only few support latest 3.8+ --><ref>{{Cite web |title=Download Python for Other Platforms |url=https://www.python.org/download/other/ |access-date=2023-08-18 |website=Python.org |language=en |archive-date=27 November 2020 |archive-url=https://web.archive.org/web/20201127015815/https://www.python.org/download/other/ |url-status=live}}</ref><ref>{{Cite web |title=test – Regression tests package for Python – Python 3.7.13 documentation |url=https://docs.python.org/3.7/library/test.html?highlight=android#test.support.is_android |access-date=2022-05-17 |website=docs.python.org |archive-date=17 May 2022 |archive-url=https://web.archive.org/web/20220517151240/https://docs.python.org/3.7/library/test.html?highlight=android#test.support.is_android |url-status=live}}</ref><ref>{{Cite web |title=platform – Access to underlying platform's identifying data – Python 3.10.4 documentation |url=https://docs.python.org/3/library/platform.html?highlight=android |access-date=2022-05-17 |website=docs.python.org |archive-date=17 May 2022 |archive-url=https://web.archive.org/web/20220517150826/https://docs.python.org/3/library/platform.html?highlight=android |url-status=live}}</ref>
| influenced = [[Boo programming language|Boo]], [[Groovy (programming language)|Groovy]], [[Ruby programming language|Ruby]], [[Cobra (programming language from Cobra Language LLC)|Cobra]]
<!--
| operating_system = [[Cross-platform]]
https://mail.python.org/archives/list/python-committers@python.org/thread/K757345KX6W5ZLTWYBUXOXQTJJTL7GW5/
| license = [[Python Software Foundation License]]
| website = http://www.python.org/
}}
'''Python''' is a general-purpose, [[high-level programming language]].<ref>{{cite web |url= http://www.python.org/doc/faq/general/#what-is-python-good-for|title= What is Python Good For?|accessdate=2008-09-05 |work= General Python FAQ|publisher= Python Foundation}}</ref> Its design philosophy emphasizes programmer productivity and code readability.<ref>{{ cite web | url = http://www.python.org/doc/essays/blurb/ | title = What is Python? Executive Summary | publisher = Python Foundation | work = Python documentation | accessdate = 2007-03-21 }}</ref> Python's core syntax and semantics are [[Minimalism (computing)|minimalist]], while the [[standard library]] is large and comprehensive. It is unusual among popular programming languages in using [[whitespace (computer science)|whitespace]] as block delimiters.


* Alpine / musl is not supported, because our test suite is failing due to bugs and missing features in musl libc.
Python supports multiple [[programming paradigm]]s (primarily
* NetBSD and OpenBSD are in a similar state as Alpine: no stable buildbot and AFAIK tests are failing
[[Object-oriented programming|object oriented]], [[Imperative programming|imperative]], and [[Functional programming|functional]]) and features a fully [[dynamic type]] system and automatic [[memory management]], similar to [[Perl]], [[Ruby (programming language)|Ruby]], [[Scheme (programming language)|Scheme]], and [[Tcl]].
* Android is no longer actively maintained
* Cygwin and MinGW are officially unsupported, see bpo-45537 and bpo-45538


..
Python was first released by [[Guido van Rossum]] in 1991.<ref name="svn-history">{{ cite web | title = HISTORY | url = http://svn.python.org/view/*checkout*/python/trunk/Misc/HISTORY | work = Python source distribution | publisher = Python Foundation | accessdate = 2007-03-21 }}</ref> The language has an open, community-based development model managed by the non-profit [[Python Software Foundation]]. While various parts of the language have formal specifications and standards, the language as a whole is not formally specified. The ''[[de facto]]'' standard for the language is the [[CPython]] implementation.


Esp. Android and possibly iOS are platforms which Python should be targeting in the future, since the story for Python on those platforms currently is pretty.
==History==
[[Image:PythonProgLogo.png|thumb|Python logo, 1990s-2005]]
Python was conceived in the late 1980s<ref name="venners-interview-pt-1">{{cite web|url = http://www.artima.com/intv/pythonP.html|title = The Making of Python|accessdate = 2007-03-22|publisher = Artima Developer}}</ref> by Guido van Rossum at [[National Research Institute for Mathematics and Computer Science|CWI]] in the [[Netherlands]] as a successor to the [[ABC programming language]] capable of [[exception handling]] and interfacing with the [[Amoeba distributed operating system|Amoeba operating system]].<ref name = "faq-created">{{ cite web | url = http://www.python.org/doc/faq/general/#why-was-python-created-in-the-first-place | title = Why was Python created in the first place? | publisher = Python FAQ | accessdate = 2007-03-22}}</ref> Van Rossum is Python's principal author, and his continuing central role in deciding the direction of Python is reflected in the title given him by the Python community, [[Benevolent Dictator For Life|''Benevolent Dictator for Life'' (BDFL)]].


..
===First publication===
In [[1991]], van Rossum published the code (labeled version 0.9.0) to alt.sources.<ref name="svn-history" /> Already present at this stage in development were classes with inheritance, exception handling, functions, and the core datatypes of <code>list</code>, <code>dict</code>, <code>str</code> and so on. Also in this initial release was a [[module system]] borrowed from [[Modula-3]]; van Rossum describes the module as "one of Python's major programming units".<ref name="venners-interview-pt-1" /> Python's exception model also resembles Modula-3's, with the addition of an <code>else</code> clause.<ref name = "faq-created" /> In 1994 [news://comp.lang.python comp.lang.python], the primary discussion forum for Python, was formed, marking a milestone in the growth of Python's userbase.


The policy Brett is proposing just makes that explicit and gives us something to point to when someone comes up with a patch to support PDP-11 or when someone's patch for Android breaks Windows. I don't think we'll wind up with tier support police; if a core dev wants to take responsibility for a patch for a platform that is not tier 3 or above they can still do that, but if it breaks things for a supported platform it will be reverted.
===Version 1.0===
Python reached version 1.0 in January [[1994]]. The major new features included in this release were the functional programming tools <code>[[lambda calculus|lambda]]</code>, <code>map</code>, <code>filter</code> and <code>[[Fold (higher-order function)|reduce]]</code>. Van Rossum stated that “Python acquired lambda, reduce(), filter() and map(), courtesy of (I believe) a Lisp hacker who missed them and submitted working patches.”<ref>{{cite web|url = http://www.artima.com/weblogs/viewpost.jsp?thread=98196|title = The fate of reduce() in Python 3000|author = Guido van Rossum|accessdate = 2007-03-22|publisher = Artima Developer}}</ref>


..
The last version released while van Rossum was at CWI was Python 1.2. In 1995, van Rossum continued his work on Python at the [[Corporation for National Research Initiatives]] (CNRI) in [[Reston, Virginia|Reston]], [[Virginia]] from which he released several versions.


E.g. Android support was even funded by the PSF recently. Why would we want to remove that support from the code base again, just because we don't have a core dev maintaining it ?
By version 1.4, Python had acquired several new features. Notable among these are the [[Modula-3]] inspired [[keyword argument]]s (which are also similar to [[Common Lisp]]'s keyword arguments), and built-in support for [[complex number]]s. Also included is a basic form of [[data hiding]] by [[name mangling]], though this is easily bypassed.<ref>{{cite web|url=http://www.amk.ca/python/writing/12-14|title=LJ #37: Python 1.4 Update|accessdate=2007-04-29}}</ref>
Also note that the stdlib does in fact support other Python implementations reusing (parts of) it, e.g. Jython, PyPy and IronPython. Again, without core devs backing these.
-->
| license = [[Python Software Foundation License]]
| file ext = .py, .pyw, .pyz,<!-- Too much trivia?: (since 3.5), since 3.8 latest supported and Python 3.5.10 Sept. 5, 2020--><ref>{{cite web |url=https://www.python.org/dev/peps/pep-0441/ |last=Holth |first=Moore |date=30 March 2014 |access-date=12 November 2015 |title=PEP 0441 – Improving Python ZIP Application Support |archive-date=26 December 2018 |archive-url=https://web.archive.org/web/20181226141117/https://www.python.org/dev/peps/pep-0441/%20 |url-status=live}}</ref><br/>
.pyi, .pyc, .pyd<!-- too much trivia: .pyo (before 3.5)<ref>File extension .pyo was removed in Python 3.5. See [https://www.python.org/dev/peps/pep-0488/ PEP 0488] {{Webarchive|url=https://web.archive.org/web/20200601133202/https://www.python.org/dev/peps/pep-0488/ |date=1 June 2020}}</ref> -->
| website = {{URL|https://www.python.org/|python.org}}
| dialects = [[Cython]], [[PyPy#RPython|RPython]], [[Bazel (software)|Starlark]]<ref>{{cite web|title=Starlark Language|url=https://docs.bazel.build/versions/master/skylark/language.html|access-date=25 May 2019|archive-date=15 June 2020|archive-url=https://web.archive.org/web/20200615140534/https://docs.bazel.build/versions/master/skylark/language.html|url-status=live}}</ref>
| influenced by = [[ABC (programming language)|ABC]],<ref name="faq-created"/> [[Ada (programming language)|Ada]],<ref>{{cite web |url=http://archive.adaic.com/standards/83lrm/html/lrm-11-03.html#11.3 |title=Ada 83 Reference Manual (raise statement) |access-date=7 January 2020 |archive-date=22 October 2019 |archive-url=https://web.archive.org/web/20191022155758/http://archive.adaic.com/standards/83lrm/html/lrm-11-03.html#11.3 |url-status=live}}</ref> [[ALGOL 68]],<ref name="98-interview"/> <br>[[APL (programming language)|APL]],<ref name="python.org">{{cite web|url=https://docs.python.org/3/library/itertools.html|title=itertools – Functions creating iterators for efficient looping – Python 3.7.1 documentation|website=docs.python.org|access-date=22 November 2016|archive-date=14 June 2020|archive-url=https://web.archive.org/web/20200614153629/https://docs.python.org/3/library/itertools.html |quote=This module implements a number of iterator building blocks inspired by constructs from APL, Haskell, and SML. |url-status=live}}</ref> [[C (programming language)|C]],<ref name="AutoNT-1"/> [[C++]],<ref name="classmix"/> [[CLU (programming language)|CLU]],<ref name="effbot-call-by-object"/> [[Dylan (programming language)|Dylan]],<ref name="AutoNT-2"/> <br>[[Haskell]],<ref name="AutoNT-3"/><ref name="python.org"/> [[Icon (programming language)|Icon]],<ref name="AutoNT-4"/> [[Lisp (programming language)|Lisp]],<ref name="AutoNT-6"/> {{nowrap|<br>[[Modula-3]]}},{{r|98-interview}}<ref name="classmix"/> [[Perl]],<ref>{{cite web |title=re – Regular expression operations – Python 3.10.6 documentation |url=https://docs.python.org/3/library/re.html |website=docs.python.org |access-date=2022-09-06 |quote=This module provides regular expression matching operations similar to those found in Perl. |archive-date=18 July 2018 |archive-url=https://web.archive.org/web/20180718132241/https://docs.python.org/3/library/re.html |url-status=live}}</ref> [[Standard ML]]<ref name="python.org"/>
| influenced = [[Apache Groovy]], [[Boo (programming language)|Boo]], [[Cobra (programming language)|Cobra]], [[CoffeeScript]],<ref>{{Cite web|url=https://coffeescript.org/|title=CoffeeScript|website=coffeescript.org|access-date=3 July 2018|archive-date=12 June 2020|archive-url=https://web.archive.org/web/20200612100004/http://coffeescript.org/|url-status=live}}</ref> [[D (programming language)|D]], [[F Sharp (programming language)|F#]], [[Godot (game engine)#GDScript|GDScript]], [[Genie (programming language)|Genie]],<ref>{{cite web
|url=https://wiki.gnome.org/action/show/Projects/Genie
|title=The Genie Programming Language Tutorial
|access-date=28 February 2020
|archive-date=1 June 2020
|archive-url=https://web.archive.org/web/20200601133216/https://wiki.gnome.org/action/show/Projects/Genie
|url-status=live
}}</ref> [[Go (programming language)|Go]], [[JavaScript]],<ref>{{cite web
|title=Perl and Python influences in JavaScript
|date=24 February 2013
|website=www.2ality.com
|url=http://www.2ality.com/2013/02/javascript-influences.html
|access-date=15 May 2015
|archive-date=26 December 2018
|archive-url=https://web.archive.org/web/20181226141121/http://2ality.com/2013/02/javascript-influences.html%0A
|url-status=live
}}</ref><ref>{{cite web
|title=Chapter 3: The Nature of JavaScript; Influences
|last=Rauschmayer
|first=Axel
|website=O'Reilly, Speaking JavaScript
|url=http://speakingjs.com/es5/ch03.html
|access-date=15 May 2015
|archive-date=26 December 2018
|archive-url=https://web.archive.org/web/20181226141123/http://speakingjs.com/es5/ch03.html%0A
|url-status=live
}}</ref> [[Julia (programming language)|Julia]],<ref name=Julia/> [[Mojo (programming language)|Mojo]],<ref name="Mojo">{{Cite web |last=Krill |first=Paul |date=2023-05-04 |title=Mojo language marries Python and MLIR for AI development |url=https://www.infoworld.com/article/3695588/mojo-language-marries-python-and-mlir-for-ai-development.html |access-date=2023-05-05 |website=InfoWorld |language=en |archive-date=5 May 2023 |archive-url=https://web.archive.org/web/20230505064554/https://www.infoworld.com/article/3695588/mojo-language-marries-python-and-mlir-for-ai-development.html |url-status=live}}</ref> [[Nim (programming language)|Nim]], [[Ring (programming language)|Ring]],<ref name="The Ring programming language and other languages">{{cite web |url=http://ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages |title=Ring and other languages |author=Ring Team |date=4 December 2017 |work=ring-lang.net |publisher=[[ring-lang]] |access-date=4 December 2017 |archive-date=25 December 2018 |archive-url=https://web.archive.org/web/20181225175312/http://ring-lang.sourceforge.net/doc1.6/introduction.html#ring-and-other-languages |url-status=live}}</ref> [[Ruby (programming language)|Ruby]],<ref name="bini"/> [[Swift (programming language)|Swift]]<ref name="lattner2014">{{Cite web |url=http://nondot.org/sabre/ |title=Chris Lattner's Homepage |last=Lattner |first=Chris |date=3 June 2014 |access-date=3 June 2014 |publisher=Chris Lattner |quote=The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. 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. |archive-date=25 December 2018 |archive-url=https://web.archive.org/web/20181225175312/http://nondot.org/sabre/ |url-status=live}}</ref>
<!-- Do not put in as there's also a pure Java implementation (Jython): | programming language = [[C (programming language)|C]] -->
| wikibooks = Python Programming
}}


'''Python''' is a [[High-level programming language|high-level]], [[general-purpose programming language]]. Its design philosophy emphasizes [[code readability]] with the use of [[off-side rule|significant indentation]].<ref name="AutoNT-7"/>
During van Rossum's stay at CNRI, he launched the [[Computer Programming for Everybody]] (CP4E) initiative, intending to make programming more accessible to more people, with a basic 'literacy' in programming languages, similar to the basic English literacy and mathematics skills required by most employers. Python served a central role in this: because of its focus on clean syntax, it was already suitable, and CP4E's goals bore similarities to its predecessor, ABC. The project was funded by [[DARPA]].<ref>{{cite web|url = http://www.python.org/doc/essays/cp4e.html|author = Guido van Rossum|title = Computer Programming for Everybody|accessdate = 2007-03-22}}</ref> {{As of|2007}}, the CP4E project is inactive, and while Python attempts to be easily learnable and not too arcane in its syntax and semantics, reaching out to non-programmers is not an active concern.<ref>{{cite web|url = http://www.python.org/cp4e/|title = Computer Programming for Everybody|accessdate = 2007-03-22|publisher = Python Software Foundation}}</ref>


Python is [[type system#DYNAMIC|dynamically typed]] and [[garbage collection (computer science)|garbage-collected]]. It supports multiple [[programming paradigm]]s, including [[structured programming|structured]] (particularly [[procedural programming|procedural]]), [[object-oriented programming|object-oriented]] and [[functional programming]]. It is often described as a "batteries included" language due to its comprehensive [[standard library]].<ref name="About"/><ref>{{Cite web|title=PEP 206 – Python Advanced Library|url=https://www.python.org/dev/peps/pep-0206/|url-status=live|archive-url=https://web.archive.org/web/20210505003659/https://www.python.org/dev/peps/pep-0206/|archive-date=5 May 2021|access-date=11 October 2021|website=Python.org}}</ref>
===BeOpen===
In [[2000]], the Python core development team moved to [[BeOpen.com]] to form the BeOpen [[PythonLabs]] team. CNRI requested that a version 1.6 be released, summarizing Python's development up to the point where the development team left CNRI. Consequently, the release schedules for 1.6 and 2.0 had a significant amount of overlap.<ref name="newin-2.0">{{cite web|url = http://www.amk.ca/python/2.0/|title = What's New in Python 2.0|author = A.M. Kuchling and Moshe Zadka|accessdate = 2007-03-22}}</ref> Python 2.0 was the first and only release from BeOpen.com. After Python 2.0 was released by BeOpen.com, Guido van Rossum and the other PythonLabs developers joined [[Digital Creations]].


[[Guido van Rossum]] began working on Python in the late 1980s as a successor to the [[ABC (programming language)|ABC programming language]] and first released it in 1991 as Python&nbsp;0.9.0.<ref>{{Cite web|last=Rossum|first=Guido Van|date=2009-01-20|title=The History of Python: A Brief Timeline of Python|url=https://python-history.blogspot.com/2009/01/brief-timeline-of-python.html|access-date=2021-03-05|website=The History of Python|archive-date=5 June 2020|archive-url=https://web.archive.org/web/20200605032200/https://python-history.blogspot.com/2009/01/brief-timeline-of-python.html|url-status=live}}</ref> Python&nbsp;2.0 was released in 2000. Python&nbsp;3.0, released in 2008, was a major revision not completely [[backward compatibility|backward-compatible]] with earlier versions. Python&nbsp;2.7.18, released in 2020, was the last release of Python&nbsp;2.<ref>{{Cite web|url=https://pythoninsider.blogspot.com/2020/04/python-2718-last-release-of-python-2.html|title= Python 2.7.18, the last release of Python 2|last=Peterson|first=Benjamin|date=20 April 2020|website=Python Insider|access-date=27 April 2020|archive-date=26 April 2020|archive-url=https://web.archive.org/web/20200426204118/https://pythoninsider.blogspot.com/2020/04/python-2718-last-release-of-python-2.html|url-status=live}}</ref>
The Python 1.6 release included a new CNRI license that was substantially longer than the CWI license that had been used for earlier releases. The new license included a clause stating that the license was governed by the laws of the [[State of Virginia]]. The [[Free Software Foundation]] argued that the choice-of-law clause was incompatible with the [[GNU GPL]]. BeOpen, CNRI, and the FSF negotiated a change to Python's [[free software license]] that would make it GPL-compatible. Python 1.6.1 is essentially the same as Python 1.6, with a few minor bug fixes, and with the new GPL-compatible license.<ref name="lib-history">{{cite web|url = http://www.python.org/doc/2.5/lib/node951.html|title = History of the software|work = Python Library Reference|accessdate = 2007-03-22}}</ref>


Python consistently ranks as one of the most popular programming languages, and has gained widespread use in the [[machine learning]] community.<ref>{{Cite web |title=Stack Overflow Developer Survey 2022 |url=https://survey.stackoverflow.co/2022/ |access-date=2022-08-12 |website=Stack Overflow |language=en |archive-date=27 June 2022 |archive-url=https://web.archive.org/web/20220627175307/https://survey.stackoverflow.co/2022/ |url-status=live}}</ref><ref>{{Cite web|title=The State of Developer Ecosystem in 2020 Infographic|url=https://www.jetbrains.com/lp/devecosystem-2020/|access-date=2021-03-05|website=JetBrains: Developer Tools for Professionals and Teams|language=en|archive-date=1 March 2021|archive-url=https://web.archive.org/web/20210301062411/https://www.jetbrains.com/lp/devecosystem-2020/|url-status=live}}</ref><ref name=tiobecurrent>{{cite web |title=TIOBE Index |publisher=TIOBE |url=https://www.tiobe.com/tiobe-index/ |access-date=3 January 2023 |quote=The TIOBE Programming Community index is an indicator of the popularity of programming languages |archive-date=25 February 2018 |archive-url=https://web.archive.org/web/20180225101948/https://www.tiobe.com/tiobe-index/ |url-status=live}} Updated as required.</ref><ref>{{Cite web|title=PYPL PopularitY of Programming Language index|url=https://pypl.github.io/PYPL.html|access-date=2021-03-26|website=pypl.github.io|language=en|archive-date=14 March 2017|archive-url=https://web.archive.org/web/20170314232030/https://pypl.github.io/PYPL.html|url-status=live}}</ref>
===Version 2.0===
Python 2.0 introduced [[list comprehension]]s, a feature borrowed from the [[functional programming]] languages [[SETL]] and [[Haskell (programming language)|Haskell]]. Python's syntax for this construct is very similar to Haskell's, apart from Haskell's preference for punctuation characters and Python's preference for alphabetic keywords. Python 2.0 also introduced a [[garbage collection (computer science)|garbage collection]] system capable of collecting reference cycles.<ref name="newin-2.0" />


==History==
Python 2.1 was close to Python 1.6.1, as well as Python 2.0. Its license was renamed [[Python Software Foundation License]]. All code, documentation and specifications added, from the time of Python 2.1's alpha release on, is owned by the [[Python Software Foundation]] (PSF), a non-profit organization formed in 2001, modeled after the [[Apache Software Foundation]].<ref name="lib-history" /> The release included a change to the language specification to support nested scopes, like other [[static scoping|statically scoped]] languages.<ref>{{cite web|url = http://www.python.org/dev/peps/pep-0227/|title = Statically Nested Scopes|author = Jeremy Hylton|accessdate = 2007-03-22}}</ref> (The feature was turned off by default, and not required, until Python 2.2.)
[[File:Guido van Rossum OSCON 2006 cropped.png|thumb|150px|The designer of Python, [[Guido van Rossum]], at [[O'Reilly Open Source Convention|OSCON]] 2006]]


{{Main|History of Python}}
A major innovation in Python 2.2 was the unification of Python's types (types written in C), and classes (types written in Python) into one hierarchy. This single unification made Python's object model purely and consistently object oriented.<ref>{{cite web |url= http://www.python.org/doc/2.2.3/whatsnew/sect-rellinks.html|title= PEPs 252 and 253: Type and Class Changes|accessdate=2008-09-05 |author= A.M. Kuchling|date= 2001-12-21|work= What's New in Python 2.2|publisher= Python Foundation}}</ref> Also added were [[generator (computer science)|generator]]s which were inspired by [[Icon (programming language)|Icon]].<ref>{{cite web |url= http://www.python.org/doc/2.2.3/whatsnew/node5.html|title= PEP 255: Simple Generators|accessdate=2008-09-05 |author= A.M. Kuchling|date= 2001-12-21|work= What's New in Python 2.2|publisher= Python Foundation}}</ref>


Python was invented in the late 1980s<ref name="venners-interview-pt-1"/> by [[Guido van Rossum]] at [[Centrum Wiskunde & Informatica]] (CWI) in the [[Netherlands]] as a successor to the [[ABC (programming language)|ABC programming language]], which was inspired by [[SETL]],<ref name="AutoNT-12"/> capable of [[exception handling]] and interfacing with the [[Amoeba (operating system)|Amoeba]] operating system.<ref name="faq-created"/> Its implementation began in December&nbsp;1989.<ref name="timeline-of-python"/> Van Rossum shouldered sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from his responsibilities as Python's "[[benevolent dictator for life]]" (BDFL), a title the Python community bestowed upon him to reflect his long-term commitment as the project's chief decision-maker<ref name="lj-bdfl-resignation"/> (he's since come out of retirement and is self-titled "BDFL-emeritus"<!-- on his Twitter-->). In January&nbsp;2019, active Python core developers elected a five-member Steering Council to lead the project.<ref>{{cite web |title=PEP 8100 |url=https://www.python.org/dev/peps/pep-8100/ |publisher=Python Software Foundation |access-date=4 May 2019 |archive-date=4 June 2020 |archive-url=https://web.archive.org/web/20200604235027/https://www.python.org/dev/peps/pep-8100/ |url-status=live}}</ref><ref>{{Cite web|title=PEP 13 – Python Language Governance|url=https://www.python.org/dev/peps/pep-0013/|access-date=2021-08-25|website=Python.org|language=en|archive-date=27 May 2021|archive-url=https://web.archive.org/web/20210527000035/https://www.python.org/dev/peps/pep-0013/|url-status=live}}</ref>
===Java legacy===
Python's standard library additions and syntactical choices were strongly influenced by [[Java (programming language)|Java]] in some cases: the <code>logging</code> package,<ref>[http://www.python.org/dev/peps/pep-0282/ PEP 282 - A Logging System<!-- Bot generated title -->]</ref> introduced in version 2.3,<ref>[http://www.python.org/doc/2.3/whatsnew/node9.html 8 PEP 282: The logging Package<!-- Bot generated title -->]</ref> the [[SAX]] parser, introduced in 2.0, and the [[Python syntax and semantics#Decorators|decorator]] syntax that uses <code>@</code>,<ref>[http://www.python.org/dev/peps/pep-0318/ PEP 318 - Decorators for Functions and Methods<!-- Bot generated title -->]</ref> added in version 2.4<ref>[http://www.python.org/doc/2.4/whatsnew/node6.html 5 PEP 318: Decorators for Functions and Methods<!-- Bot generated title -->]</ref>


Python 2.0 was released on 16 October 2000, with many major new features such as [[list comprehension]]s, [[cycle detection|cycle-detecting]] garbage collection, [[reference counting]], and [[Unicode]] support.<ref name="newin-2.0"/> Python&nbsp;3.0, released on 3 December 2008, with many of its major features [[backporting|backported]] to Python&nbsp;2.6.x<ref name="pep-3000"/> and 2.7.x. Releases of Python&nbsp;3 include the <code>2to3</code> utility, which automates the translation of Python&nbsp;2 code to Python&nbsp;3.<ref>{{Cite web|title=2to3 – Automated Python 2 to 3 code translation|url=https://docs.python.org/3/library/2to3.html|access-date=2021-02-02|website=docs.python.org|archive-date=4 June 2020|archive-url=https://web.archive.org/web/20200604232823/https://docs.python.org/3/library/2to3.html|url-status=live}}</ref>
==Future development==


Python 2.7's [[end-of-life product|end-of-life]] was initially set for 2015, then postponed to 2020 out of concern that a large body of existing code could not easily be forward-ported to Python&nbsp;3.<ref>{{cite web |url=https://legacy.python.org/dev/peps/pep-0373/ |title=PEP 373 – Python 2.7 Release Schedule |work=python.org |access-date=9 January 2017 |archive-date=19 May 2020 |archive-url=https://web.archive.org/web/20200519075520/https://legacy.python.org/dev/peps/pep-0373/ |url-status=live}}</ref><ref>{{cite web |url=https://www.python.org/dev/peps/pep-0466/ |title=PEP 466 – Network Security Enhancements for Python 2.7.x |work=python.org |access-date=9 January 2017 |archive-date=4 June 2020 |archive-url=https://web.archive.org/web/20200604232833/https://www.python.org/dev/peps/pep-0466/ |url-status=live}}</ref> No further security patches or other improvements will be released for it.<ref>{{Cite web|url=https://www.python.org/doc/sunset-python-2/|title=Sunsetting Python 2|website=Python.org|language=en|access-date=22 September 2019|archive-date=12 January 2020|archive-url=https://web.archive.org/web/20200112080903/https://www.python.org/doc/sunset-python-2/|url-status=live}}</ref><ref>{{Cite web|url=https://www.python.org/dev/peps/pep-0373/|title=PEP 373 – Python 2.7 Release Schedule|website=Python.org|language=en|access-date=22 September 2019|archive-date=13 January 2020|archive-url=https://web.archive.org/web/20200113033257/https://www.python.org/dev/peps/pep-0373/|url-status=live}}</ref> Currently only 3.8 and later are supported (2023 security issues were fixed in e.g. 3.7.17, the final 3.7.x release<ref>{{Cite web |title=Python Release Python 3.7.17 |url=https://www.python.org/downloads/release/python-3717/ |access-date=2023-08-18 |website=Python.org |language=en |archive-date=31 July 2023 |archive-url=https://web.archive.org/web/20230731174749/https://www.python.org/downloads/release/python-3717/ |url-status=live}}</ref>). While Python 2.7 and older is officially unsupported, a different unofficial Python implementation, [[PyPy]], continues to support Python 2, i.e. "2.7.18+" (plus 3.9 and 3.10), with the plus meaning (at least some) "[[backporting|backported]] security updates".<ref>{{Cite web |last=mattip |date=2023-12-25 |title=PyPy v7.3.14 release |url=https://www.pypy.org/posts/2023/12/pypy-v7314-release.html |access-date=2024-01-05 |website=PyPy |language=en |archive-date=5 January 2024 |archive-url=https://web.archive.org/web/20240105132820/https://www.pypy.org/posts/2023/12/pypy-v7314-release.html |url-status=live}}</ref>
A Python Enhancement Proposal (or "PEP") is a standardized design document providing general information related to Python, including proposals, descriptions, and explanations for language features. PEPs are intended as the primary channel for proposing new features, and for documenting the underlying design rationale for all major elements of Python.<ref name="PepCite000">[http://www.python.org/dev/peps/pep-0001/ PEP 1 -- PEP Purpose and Guidelines]</ref> Outstanding PEPs are reviewed and commented upon by van Rossum, the BDFL.<ref name="PepCite001">[http://www.python.org/doc/essays/pepparade.html Parade of the PEPs<!-- Bot generated title -->]</ref>


In 2021 (and again twice in 2022), security updates were expedited, since all Python versions were insecure (including 2.7<ref>{{Cite web|title=CVE-2021-3177 |url=https://access.redhat.com/security/cve/cve-2021-3177|access-date=2021-02-26|website=Red Hat Customer Portal |archive-date=6 March 2021|archive-url=https://web.archive.org/web/20210306183700/https://access.redhat.com/security/cve/cve-2021-3177|url-status=live}}</ref>) because of security issues leading to possible [[remote code execution]]<ref>{{Cite web|title= CVE-2021-3177|url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177|access-date=2021-02-26|website=CVE|archive-date=27 February 2021|archive-url=https://web.archive.org/web/20210227192918/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3177|url-status=live}}</ref> and [[cache poisoning|web-cache poisoning]].<ref>{{Cite web|title= CVE-2021-23336|url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23336|access-date=2021-02-26|website=CVE|archive-date=24 February 2021|archive-url=https://web.archive.org/web/20210224160700/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-23336|url-status=live}}</ref> In 2022, Python&nbsp;3.10.4 and 3.9.12 were expedited<ref>{{Cite web |last=Langa |first=Łukasz |date=2022-03-24 |title= Python 3.10.4 and 3.9.12 are now available out of schedule |url=https://pythoninsider.blogspot.com/2022/03/python-3104-and-3912-are-now-available.html |access-date=2022-04-19 |website=Python Insider |archive-date=21 April 2022 |archive-url=https://web.archive.org/web/20220421205820/https://pythoninsider.blogspot.com/2022/03/python-3104-and-3912-are-now-available.html |url-status=live}}</ref> and 3.8.13, because of many security issues.<ref>{{Cite web |last=Langa |first=Łukasz |date=2022-03-16 |title= Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 are now available with security content |url=https://pythoninsider.blogspot.com/2022/03/python-3103-3911-3813-and-3713-are-now.html |access-date=2022-04-19 |website=Python Insider |archive-date=17 April 2022 |archive-url=https://web.archive.org/web/20220417215022/https://pythoninsider.blogspot.com/2022/03/python-3103-3911-3813-and-3713-are-now.html |url-status=live}}</ref> When Python&nbsp;3.9.13 was released in May 2022, it was announced that the 3.9 series (joining the older series 3.8 and 3.7) would only receive security fixes in the future.<ref>{{Cite web |last=Langa |first=Łukasz |date=2022-05-17 |title= Python 3.9.13 is now available |url=https://pythoninsider.blogspot.com/2022/05/python-3913-is-now-available.html |access-date=2022-05-21 |website=Python Insider |archive-date=17 May 2022 |archive-url=https://web.archive.org/web/20220517173546/https://pythoninsider.blogspot.com/2022/05/python-3913-is-now-available.html |url-status=live}}</ref> On 7 September 2022, four new releases were made due to a potential [[denial-of-service attack]]: 3.10.7, 3.9.14, 3.8.14, and 3.7.14.<ref>{{Cite web |title= Python releases 3.10.7, 3.9.14, 3.8.14, and 3.7.14 are now available |work=Python Insider |first1=Łukasz |last1=Langa |date=7 September 2022 |access-date=16 September 2022 |url=https://pythoninsider.blogspot.com/2022/09/python-releases-3107-3914-3814-and-3714.html |archive-date=13 September 2022 |archive-url=https://web.archive.org/web/20220913001104/https://pythoninsider.blogspot.com/2022/09/python-releases-3107-3914-3814-and-3714.html |url-status=live}}</ref><ref>{{Cite web |title= CVE-2020-10735 |work=CVE |access-date=16 September 2022 |url=https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735 |archive-date=20 September 2022 |archive-url=https://web.archive.org/web/20220920170528/https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735 |url-status=live}}</ref>
===Python 3000===


{{As of|2023|10|post=,}} Python 3.12 is the stable release, and 3.12 and 3.11 are the only versions with active (as opposed to just security) support. Notable changes in 3.11 from 3.10 include increased program execution speed and improved error reporting.<ref>{{Cite web |title=Python 3.11 released [LWN.net] |author=corbet |work=lwn.net |date=24 October 2022 |access-date=15 November 2022 |url= https://lwn.net/Articles/912216/}}</ref>
There are plans for a future version, to be called Python 3.0 (the project is called "Python 3000" or "Py3K") that will break backwards compatibility with the 2.x series in order to repair perceived flaws in the language. The guiding principle is to "reduce feature duplication by removing old ways of doing things".


Python 3.12 adds syntax (and in fact every Python since at least 3.5 adds some syntax) to the language, the new (soft) keyword <code>type</code> (recent releases have added a lot of typing support e.g. new type union operator in 3.10), and 3.11 for exception handling, and 3.10 the <code>match</code> and <code>case</code> (soft) keywords, for structural [[pattern matching]] statements. Python 3.12 also drops outdated modules and functionality, and future versions will too, see below in [[#Development|Development]] section.
====Philosophy====
Python 3.0 is being developed with the same philosophy as in prior versions, so any reference to [[#Programming philosophy|Python philosophy]] will apply to Python 3.0 as well. However, as Python has accumulated new and redundant ways to program the same task, Python 3.0 has an emphasis on removing duplicative constructs and modules, in keeping with “There should be one—and preferably only one—obvious way to do it”.


Python 3.11 claims to be between 10 and 60% faster than Python 3.10, and Python 3.12 adds another 5% on top of that. It also has improved error messages, and many other changes.
Nonetheless, Python 3.0 will remain a [[Multi-paradigm programming language|multi-paradigm language]]. Coders will still have options among [[object orientation]], [[structured programming]], [[functional programming]], and [[aspect-oriented programming]] and other paradigms, but within such broad choices, the details are intended to be more obvious in Python 3.0 than they have become in Python 2.x.


{{As of|2023|June|27|since=y}}, Python 3.8 is the oldest supported version of Python (albeit in the 'security support' phase), due to Python 3.7 reaching [[end-of-life product|end-of-life]].<ref>{{Cite web |date=2023-08-10 |title=Python |url=https://endoflife.date/python |access-date=2023-08-15 |website=endoflife.date |language=en-US |archive-date=18 September 2021 |archive-url=https://web.archive.org/web/20210918162455/https://endoflife.date/python |url-status=live}}</ref>
====Timeline and compatibility====
The first release candidate of Python 3.0 was released on [[September 17]], [[2008]].<ref>[http://python.org/download/releases/3.0/ Python 3.0rc1 Release]</ref>
The Python 2.x and Python 3.x series will coexist for several releases in parallel, where the 2.x series exists largely for compatibility and with some new features being backported from the 3.x series. [http://www.python.org/dev/peps/pep-3000/ PEP 3000] contains more information about the release schedule.


Python 3.13<!-- now beta1 --> introduced an ''incremental'' (shorter pauses for collection in programs with a lot of objects) garbage collector, an experimental [[just-in-time compiler|JIT compiler]];,<ref>{{Cite web |title=What's New In Python 3.13 |url=https://docs.python.org/3.13/whatsnew/3.13.html#experimental-jit-compiler |access-date=2024-04-30 |website=Python documentation |language=en}}</ref> and removals from the C API. Some standard library modules, 19 ''dead batteries'', and many deprecated classes, functions and methods, and more will be removed in Python 3.15 and or 3.16.<ref>{{Cite web |last=Wouters |first=Thomas |date=2024-04-09 |title=Python Insider: Python 3.12.3 and 3.13.0a6 released |url=https://pythoninsider.blogspot.com/2024/04/python-3123-and-3130a6-released.html |access-date=2024-04-29 |website=Python Insider}}</ref> Starting with 3.13, it and later versions have 2 years of full support (up from one and a half); followed by 3 years of security support (for same total support as before).
Python 3.0 will break [[backward compatibility]]. There is no requirement that Python 2.x code will run unmodified on Python 3.0. There are basic changes such as changing the print statement into a print function (so any use of print as a statement will cause the program to fail), and switching to Unicode for all text strings. Python's [[dynamic typing]] combined with the plans to change the semantics of certain methods of dictionaries, for example, makes perfect [[source-to-source compiler|mechanical translation]] from Python 2.x to Python 3.0 very difficult. However, a tool called "2to3" does most of the job of translation, pointing out areas of uncertainty using comments or warnings. Even in an alpha stage, 2to3 appears to be fairly successful at performing the translation.<ref>Sam Ruby, [http://intertwingly.net/blog/2007/09/01/2to3 2to3], September 1, 2007</ref> [http://www.python.org/dev/peps/pep-3000/ PEP 3000] recommends keeping one source (for the 2.x series), and producing releases for the Python 3.x platform using 2to3. The resulting code should not be edited until the program no longer needs to run on Python 2.x.


==Design philosophy and features==
Python 2.6 will include forward compatibility features, as well as a "warnings" mode that will warn of potential transition problems. Warnings will be reported for builtins which will no longer exist in 3.0, as well as various old Python 2.x features that Python 3.0 will remove (see [http://www.python.org/dev/peps/pep-0361/ PEP 361] for more information).
Python is a [[multi-paradigm programming language]]. [[Object-oriented programming]] and [[structured programming]] are fully supported, and many of their features support functional programming and [[aspect-oriented programming]] (including [[metaprogramming]]<ref name="AutoNT-13"/> and [[metaobject]]s).<ref name="AutoNT-14"/> Many other paradigms are supported via extensions, including [[design by contract]]<ref name="AutoNT-15"/><ref name="AutoNT-16"/> and [[logic programming]].<ref name="AutoNT-17"/>


Python uses [[dynamic typing]] and a combination of [[reference counting]] and a cycle-detecting garbage collector for [[memory management]].<ref name="Reference_counting">{{Cite web |url=https://docs.python.org/extending/extending.html#reference-counts |title=Extending and Embedding the Python Interpreter: Reference Counts |publisher=Docs.python.org |language=en |access-date=5 June 2020 |quote=Since Python makes heavy use of <code>malloc()</code> and <code>free()</code>, it needs a strategy to avoid memory leaks as well as the use of freed memory. The chosen method is called ''reference counting''. |archive-date=18 October 2012 |archive-url=https://web.archive.org/web/20121018063230/http://docs.python.org/extending/extending.html#reference-counts |url-status=live}}</ref> It uses dynamic [[Name resolution (programming languages)|name resolution]] ([[late binding]]), which binds method and variable names during program execution.
====Features====
Some of the major changes scheduled for Python 3.0 are:


Its design offers some support for functional programming in the [[Lisp (programming language)|Lisp]] tradition. It has {{codes|filter|map|reduce|d=and}} functions; [[list comprehension]]s, [[Associative array|dictionaries]], sets, and [[generator (computer programming)|generator]] expressions.<ref name="AutoNT-59"/> The standard library has two modules ({{codes|itertools}} and {{codes|functools}}) that implement functional tools borrowed from [[Haskell]] and [[Standard ML]].<ref name="AutoNT-18"/>
* Changing <code>print</code> so that it is a built-in function, not a statement. This makes it easier to change a module to use a different print function, as well as making the syntax more regular. In Python 2.6 this can be enabled by entering <code>from __future__ import print_function</code>.<ref>[http://www.python.org/dev/peps/pep-3105/ PEP 3105]</ref>
* Moving <code>reduce</code> (but not <code>map</code> or <code>filter</code>) out of the built-in namespace and into functools (the rationale being that operations using ''reduce'' are expressed more clearly using an accumulation loop);<ref>[http://www.artima.com/weblogs/viewpost.jsp?thread=211200 Thread on Artima programmer blog]</ref>
* Adding support for optional function annotations that can be used for informal type declarations or other purposes;<ref>[http://www.python.org/dev/peps/pep-3107/ PEP 3197]</ref>
* Unifying the <code>str</code>/<code>unicode</code> types, representing text, and introducing a separate immutable <code>bytes</code> type; and a mostly corresponding mutable <code>bytearray</code> type, which both represent arrays of [[byte]]s;<ref>[http://www.python.org/dev/peps/pep-3137/ PEP 3137]: Immutable Bytes and Mutable Buffer</ref>
* Removing backward-compatibility features, including old-style classes, integer-truncating division, string exceptions, and implicit relative imports.


Its core philosophy is summarized in the [[Zen of Python]] (PEP 20), which includes [[aphorism]]s such as:<ref name="PEP20"/>
==Usage==
<!-- Note this isn't a full list, just some of the more significant aphorisms -->
{{main|Python software}}
* Beautiful is better than ugly.
* Explicit is better than implicit.
* Simple is better than complex.
* Complex is better than complicated.
* Readability counts.


However, Python features regularly violate these principles and received criticism for adding unnecessary language bloat.<ref name="Python-Changes-2014">{{cite web |url=https://learning-python.com/python-changes-2014-plus.html |title=Python Changes 2014+ |last=Lutz |first=Mark |date=January 2022 |website=Learning Python |access-date=2024-02-25 |archive-date=15 March 2024 |archive-url=https://web.archive.org/web/20240315075935/https://learning-python.com/python-changes-2014-plus.html |url-status=live}}</ref><ref name="Python-is-not-a-great-programming-language">{{cite web |url=https://gist.github.com/RobertAKARobin/a1cba47d62c009a378121398cc5477ea |title=Python is not a great programming language |last=Thomas |first=Robin |date=2023-05-03 |website=GitHub Gist |access-date=2024-02-25 |archive-date=31 December 2023 |archive-url=https://web.archive.org/web/20231231092949/https://gist.github.com/RobertAKARobin/a1cba47d62c009a378121398cc5477ea |url-status=live}}</ref> Responses to these criticisms are that the Zen of Python is a guideline rather than a rule.<ref name="Confusion-regarding-a-rule-in-the-Zen-of-Python">{{cite web |url=https://discuss.python.org/t/confusion-regarding-a-rule-in-the-zen-of-python/15927 |title=Confusion regarding a rule in The Zen of Python |author=<!--Not stated--> |date=2022-05-03 |website=Python Help - Discussions on Python.org |access-date=2024-02-25 |archive-date=25 February 2024 |archive-url=https://web.archive.org/web/20240225221142/https://discuss.python.org/t/confusion-regarding-a-rule-in-the-zen-of-python/15927 |url-status=live}}</ref> The addition of some new features had been so controversial that Guido van Rossum resigned as Benevolent Dictator for Life following vitriol over the addition of the assignment expression operator in Python 3.8.<ref name="The-Most-Controversial-Python-Walrus-Operator">{{cite web |url=https://pythonsimplified.com/the-most-controversial-python-walrus-operator/ |title=The Most Controversial Python Walrus Operator |last=Ambi |first=Chetan |date=2021-07-04 |website=Python Simplified |access-date=2024-02-05 |archive-date=27 August 2023 |archive-url=https://web.archive.org/web/20230827154931/https://pythonsimplified.com/the-most-controversial-python-walrus-operator/ |url-status=live}}</ref><ref name="The-Controversy-Behind-The-Walrus-Operator-in-Python">{{cite web |url=https://therenegadecoder.com/code/the-controversy-behind-the-walrus-operator-in-python/ |title=The Controversy Behind The Walrus Operator in Python |last=Grifski |first=Jeremy |date=2020-05-24 |website=The Renegade Coder |access-date=2024-02-25 |archive-date=28 December 2023 |archive-url=https://web.archive.org/web/20231228135749/https://therenegadecoder.com/code/the-controversy-behind-the-walrus-operator-in-python/ |url-status=live}}</ref>
Some of the largest projects that use Python are the [[Zope]] application server, [[YouTube]]<ref>[http://www.python.org/about/quotes/ Quotes about Python<!-- Bot generated title -->]</ref><ref>[http://sayspy.blogspot.com/2006/12/youtube-runs-on-python.html Coder Who Says Py: YouTube runs on Python!<!-- Bot generated title -->]</ref><ref>[http://mail.python.org/pipermail/python-dev/2006-December/070323.html [Python-Dev&#93; [Python-checkins&#93; MSI being downloaded 10x morethan all other files?!<!-- Bot generated title -->]</ref>, and the original [[BitTorrent (software)|BitTorrent client]]. Large organizations that make use of Python include [[Google]]<ref>[http://python.org/about/quotes/ Quotes about Python<!-- Bot generated title -->]</ref>, [[Yahoo!]], [[CERN]] and [[NASA]].<ref>[http://www.python.org/about/success/usa/ Python Success Stories<!-- Bot generated title -->]</ref> [[ITA Software|ITA]] uses Python for some of its components.<ref>[http://www.eweek.com/c/a/Application-Development/Python-Slithers-into-Systems/ Python Slithers into Systems by Darryl K. Taft]</ref>


Nevertheless, rather than building all of its functionality into its core, Python was designed to be highly [[Extensibility|extensible]] via modules. This compact modularity has made it particularly popular as a means of adding programmable interfaces to existing applications. Van Rossum's vision of a small core language with a large standard library and easily extensible interpreter stemmed from his frustrations with [[ABC (programming language)|ABC]], which espoused the opposite approach.<ref name="venners-interview-pt-1"/>
===Information Security===
Python has also seen extensive use in the [[information security]] industry. Notably, in several of the tools offered by Immunity Security,<ref>[http://www.immunitysec.com/products-immdbg.shtml IMMUNITY : Knowing You're Secure<!-- Bot generated title -->]</ref><ref>[http://www.immunitysec.com/resources-freesoftware.shtml IMMUNITY : Knowing You're Secure<!-- Bot generated title -->]</ref> in several of the tools offered by Core Security,<ref>[http://oss.coresecurity.com/ CORE Security Technologies' open source software repository]</ref> in the Web [[application security]] scanner Wapiti,<ref>[http://wapiti.sourceforge.net/ Wapiti - Web application security auditor<!-- Bot generated title -->]</ref> and in the [[fuzzer]] TAOF.<ref>[http://www.theartoffuzzing.com/joomla/ TAOF - theartoffuzzing.com - Home<!-- Bot generated title -->]</ref> Python is commonly used in exploit development.<ref>[http://www1.corest.com/files/files/13/CanSecWest2002.pdf Core Security | Home<!-- Bot generated title -->]</ref><ref>[http://fist.immunitysec.com/pipermail/dailydave/2004-September/000851.html [Dailydave&#93; RE: Network Exploitation Tools aka Exploitation Engines<!-- Bot generated title -->]</ref>


Python claims to strive for a simpler, less-cluttered syntax and grammar while giving developers a choice in their coding methodology. In contrast to [[Perl]]'s "[[there is more than one way to do it]]" motto, Python embraces a "there should be one—and preferably only one—obvious way to do it."<!-- the "—" spacing here, although inconsistent with Wikipedia MOS, is quoted text and must be maintained as is; do not "correct" it --> philosophy.<ref name="PEP20"/> In practice, however, Python provides many ways to achieve the same task. There are, for example, at least three ways to format a string literal, with no certainty as to which one a programmer should use.<ref name="Python-String-Formatting-Best-Practices">{{cite web |url=https://realpython.com/python-string-formatting/ |title=Python String Formatting Best Practices |last=Bader |first=Dan |website=Real Python |access-date=2024-02-25 |archive-date=18 February 2024 |archive-url=https://web.archive.org/web/20240218083506/https://realpython.com/python-string-formatting/ |url-status=live}}</ref> [[Alex Martelli]], a [[Fellow]] at the [[Python Software Foundation]] and Python book author, wrote: "To describe something as 'clever' is ''not'' considered a compliment in the Python culture."<ref name="AutoNT-19"/>
===Embedding===
Python has been successfully embedded in a number of software products as a scripting language. It is commonly used in 3D animation packages, as in [[Houdini (software)|Houdini]], [[Maya (software)|Maya]], [[Softimage XSI]], [[TrueSpace]], [[Poser]], [[Modo (software)|Modo]], [[Nuke (software)|Nuke]] and [[Blender (software)|Blender]]. It is also used in [[GIMP]], [[Krita]], [[Inkscape]], [[Scribus]] and [[Paint Shop Pro]].<ref>Documentation of the PSP Scripting API can be found at [http://www.jasc.com/support/customercare/articles/psp9components.asp ''JASC Paint Shop Pro 9: Additional Download Resources'']</ref> [[ESRI]] is now promoting Python as the best choice for writing scripts in [[ArcGIS]].<ref>{{cite web|title=About getting started with writing geoprocessing scripts | url=http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=About_getting_started_with_writing_geoprocessing_scripts | year=2006 | month=Nov | accessyear=2007 | accessmonth=Apr}}</ref> It is also used in games like [[Civilization IV]] and [[Mount%26Blade]] as the control language for modding and event interaction.<ref>[http://www.2kgames.com/civ4/blog_03.htm Civilization IV<!-- Bot generated title -->]</ref> [[Eve Online]], an [[MMORPG]], is also built using Python.<ref>[http://myeve.eve-online.com/devblog.asp?a=blog&bid=488. EVE Online | EVE Insider | Dev Blog<!-- Bot generated title -->]</ref>


Python's developers usually strive to avoid [[premature optimization]] and reject patches to non-critical parts of the [[CPython]] reference implementation that would offer marginal increases in speed at the cost of clarity.<ref name="AutoNT-20"/> Execution speed can be improved by moving speed-critical functions to extension modules written in languages such as C, or by using a [[just-in-time compilation|just-in-time compiler]] like [[PyPy]]. It is also possible to [[#Cross-compilers to other languages|cross-compile to other languages]], but it either doesn't provide the full speed-up that might be expected, since Python is a very dynamic language, or a restricted subset of Python is compiled, and possibly semantics are slightly changed.<ref name=PyJL/>
===Availability===

For many operating systems, Python is a standard component; it ships with most [[Linux distribution]]s, with [[NetBSD]], and [[OpenBSD]], and with [[Mac OS X]]. [[Red Hat Linux]] and [[Fedora (operating system)|Fedora]] both use the pythonic [[Anaconda (installer)|Anaconda]] installer. [[Gentoo Linux]] uses Python in its [[package management]] system, [[Portage (software)|Portage]], and the standard tool to access it, [[Portage (software)#emerge|emerge]]. [[Pardus (operating system)|Pardus]] uses it for administration and during system boot.<ref>[http://www.pardus.org.tr/eng/projects/comar/PythonInPardus.html :: Pardus :: TÜBİTAK/UEKAE ::<!-- Bot generated title -->]</ref>
Python's developers aim for it to be fun to use. This is reflected in its name—a tribute to the British comedy group [[Monty Python]]<ref name="whyname"/>—and in occasionally playful approaches to tutorials and reference materials, such as the use of the terms "spam" and "eggs" (a reference to [[Spam (Monty Python)|a Monty Python sketch]]) in examples, instead of the often-used [[foobar|"foo" and "bar"]].<ref>{{Cite web|url=https://insidetech.monster.com/training/articles/8114-15-ways-python-is-a-powerful-force-on-the-web|title=15 Ways Python Is a Powerful Force on the Web|access-date=3 July 2018|archive-date=11 May 2019|archive-url=https://web.archive.org/web/20190511065650/http://insidetech.monster.com/training/articles/8114-15-ways-python-is-a-powerful-force-on-the-web|url-status=dead}}</ref><ref>{{Cite web |title=pprint – Data pretty printer – Python 3.11.0 documentation |url=https://docs.python.org/3/library/pprint.html |access-date=2022-11-05 |website=docs.python.org |quote=stuff=['spam', 'eggs', 'lumberjack', 'knights', 'ni'] |archive-date=22 January 2021 |archive-url=https://web.archive.org/web/20210122224848/https://docs.python.org/3/library/pprint.html |url-status=live}}</ref> A common [[neologism]] in the Python community is ''pythonic'', which has a wide range of meanings related to program style. "Pythonic" code may use Python [[Programming idiom|idioms]] well, be natural or show fluency in the language, or conform with Python's minimalist philosophy and emphasis on readability. Code that is difficult to understand or reads like a rough transcription from another programming language is called ''unpythonic''.<ref>{{Cite web|url=https://towardsdatascience.com/how-to-be-pythonic-and-why-you-should-care-188d63a5037e|title=How to be Pythonic and why you should care|first=Robert|last=Clark|date=26 April 2019|website=Medium|access-date=20 January 2021|archive-date=13 August 2021|archive-url=https://web.archive.org/web/20210813194313/https://towardsdatascience.com/how-to-be-pythonic-and-why-you-should-care-188d63a5037e?gi=dd6bc15118b3|url-status=live}}</ref><ref>{{Cite web|url=https://docs.python-guide.org/writing/style|title=Code Style – The Hitchhiker's Guide to Python|website=docs.python-guide.org|access-date=20 January 2021|archive-date=27 January 2021|archive-url=https://web.archive.org/web/20210127154341/https://docs.python-guide.org/writing/style/|url-status=live}}</ref>


==Syntax and semantics==
==Syntax and semantics==
{{Main|Python syntax and semantics}}
[[Image:Python add5 syntax.svg|thumb|360px|[[Syntax highlighting|Syntax-highlighted]] Python code.]]
{{main|Python syntax and semantics}}


Python was intended to be a highly readable language. It aims toward an uncluttered visual layout, frequently using English keywords where other languages use punctuation. Python requires less [[boilerplate (text)|boilerplate]] than traditional statically-typed structured languages such as C or [[Pascal programming language|Pascal]], and has a smaller number of syntactic exceptions and special cases than either of these.<ref>{{ cite web | title = Is Python a good language for beginning programmers? | url = http://www.python.org/doc/faq/general/#is-python-a-good-language-for-beginning-programmers | work = General Python FAQ | date = [[7 March]] [[2005]] | accessdate = 2007-03-21 | publisher = Python Foundation }}</ref>
Python is meant to be an easily readable language. Its formatting is visually uncluttered and often uses English keywords where other languages use punctuation. Unlike many other languages, it does not use [[curly bracket programming language|curly brackets]] to delimit blocks, and semicolons after statements are allowed but rarely used. It has fewer syntactic exceptions and special cases than [[C (programming language)|C]] or [[Pascal (programming language)|Pascal]].<ref name="AutoNT-52"/>


===Indentation===
===Indentation===
{{Main|Python syntax and semantics#Indentation}}
Python uses [[whitespace (computer science)|whitespace]] indentation, rather than [[curly bracket programming language|curly braces]] or keywords, to delimit [[statement block]]s (a feature also known as the [[off-side rule]]). An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.

Python uses [[whitespace character|whitespace]] indentation, rather than [[curly bracket programming language|curly brackets]] or keywords, to delimit [[block (programming)|blocks]]. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.<ref name="AutoNT-53"/> Thus, the program's visual structure accurately represents its semantic structure.<ref name=guttag>{{Cite book |publisher=MIT Press |isbn=978-0-262-52962-4 |last=Guttag |first=John V. |title=Introduction to Computation and Programming Using Python: With Application to Understanding Data |date=12 August 2016}}</ref> This feature is sometimes termed the [[off-side rule]]. Some other languages use indentation this way; but in most, indentation has no semantic meaning. The recommended indent size is four spaces.<ref>{{Cite web|url=https://www.python.org/dev/peps/pep-0008/|title=PEP 8 – Style Guide for Python Code|website=Python.org|access-date=26 March 2019|archive-date=17 April 2019|archive-url=https://web.archive.org/web/20190417223549/https://www.python.org/dev/peps/pep-0008/|url-status=live}}</ref>


===Statements and control flow===
===Statements and control flow===
Python's statements include:
Python's [[statement (computer science)|statements]] include:
* The [[Assignment (computer science)|assignment]] statement, using a single equals sign <code>=</code>
* The <code>[[if-then-else|if]]</code> statement, which conditionally executes a block of code, along with <code>else</code> and <code>elif</code> (a contraction of else-if)
* The <code>[[Foreach#Python|for]]</code> statement, which iterates over an ''iterable'' object, capturing each element to a local variable for use by the attached block
* The <code>[[While loop#Python|while]]</code> statement, which executes a block of code as long as its condition is true
* The <code>[[Exception handling syntax#Python|try]]</code> statement, which allows exceptions raised in its attached code block to be caught and handled by <code>except</code> clauses (or new syntax <code>except*</code> in Python 3.11 for exception groups<ref>{{Cite web |title=8. Errors and Exceptions – Python 3.12.0a0 documentation |url=https://docs.python.org/3.11/tutorial/errors.html |access-date=2022-05-09 |website=docs.python.org |archive-date=9 May 2022 |archive-url=https://web.archive.org/web/20220509145745/https://docs.python.org/3.11/tutorial/errors.html |url-status=live}}</ref>); it also ensures that clean-up code in a <code>finally</code> block is always run regardless of how the block exits
* The <code>raise</code> statement, used to raise a specified exception or re-raise a caught exception
* The <code>class</code> statement, which executes a block of code and attaches its local namespace to a [[class (computer science)|class]], for use in object-oriented programming
* The <code>def</code> statement, which defines a [[function (computing)|function]] or [[method (computing)|method]]
* The <code>[[dispose pattern#Language constructs|with]]</code> statement, which encloses a code block within a context manager (for example, acquiring a [[lock (computer science)|lock]] before it is run, then releasing the lock; or opening and closing a [[Computer file|file]]), allowing [[resource acquisition is initialization|resource-acquisition-is-initialization]] (RAII)-like behavior and replacing a common try/finally idiom<ref>{{cite web|url=https://www.python.org/download/releases/2.5/highlights/|title=Highlights: Python 2.5|website=Python.org|access-date=20 March 2018|archive-date=4 August 2019|archive-url=https://web.archive.org/web/20190804120408/https://www.python.org/download/releases/2.5/highlights/|url-status=live}}</ref>
* The <code>[[break statement|break]]</code> statement, which exits a loop
* The <code>continue</code> statement, which skips the rest of the current iteration and continues with the next
* The <code>del</code> statement, which removes a variable—deleting the reference from the name to the value, and producing an error if the variable is referred to before it is redefined
* The <code>pass</code> statement, serving as a [[NOP (code)|NOP]], syntactically needed to create an empty code block
* The <code>[[assertion (programming)|assert]]</code> statement, used in debugging to check for conditions that should apply
* The <code>yield</code> statement, which returns a value from a [[generator (computer programming)#Python|generator]] function (and also an operator); used to implement [[coroutine]]s
* The <code>return</code> statement, used to return a value from a function
* The <code>[[include directive|import]]</code> and <code>from</code> statements, used to import modules whose functions or variables can be used in the current program


The assignment statement (<code>=</code>) binds a name as a [[pointer (computer programming)|reference]] to a separate, dynamically allocated [[object (computer science)|object]]. Variables may subsequently be rebound at any time to any object. In Python, a variable name is a generic reference holder without a fixed [[Type system|data type]]; however, it always refers to ''some'' object with a type. This is called [[dynamic type|dynamic typing]]—in contrast to [[statically-typed]] languages, where each variable may contain only a value of a certain type.
* The [[if-then-else|<code>if</code> statement]], which conditionally executes a block of code, along with <code>else</code> and <code>elif</code> (a contraction of else-if).
* The [[for loop|<code>for</code> statement]], which iterates over an iterable object, capturing each element to a local variable for use by the attached block.
* The <code>class</code> statement, which executes a block of code and attaches its local namespace to a [[class (computer science)|class]], for use in [[object oriented programming]].
* The <code>def</code> statement, which defines a [[function (computing)|function]].
* The <code>with</code> statement which encloses a code block within a context manager (for example, acquiring a [[lock (computer science)|lock]] before the block of code is run, and releasing the lock afterwards).


Python does not support [[tail call]] optimization or [[first-class continuations]], and, according to Van Rossum, it never will.<ref name="AutoNT-55"/><ref name="AutoNT-56"/> However, better support for [[coroutine]]-like functionality is provided by extending Python's [[generator (computer programming)|generators]].<ref name="AutoNT-57"/> Before 2.5, generators were [[lazy evaluation|lazy]] [[iterator]]s; data was passed unidirectionally out of the generator. From Python&nbsp;2.5 on, it is possible to pass data back into a generator function; and from version 3.3, it can be passed through multiple stack levels.<ref name="AutoNT-58"/>
Each statement has its own semantics: for example, the <code>def</code> statement does not execute its block immediately, unlike most other statements.


===Expressions===
CPython does not support [[continuation]]s, and according to Guido van Rossum it never will.<ref>{{ cite web | title = Language Design Is Not Just Solving Puzzles | url = http://www.artima.com/weblogs/viewpost.jsp?thread=147358 | first = Guido | last = van Rossum | date = [[9 February]] [[2006]] | accessdate = 2007-03-21 | work = Artima forums | publisher = Artima }}</ref> However, better support for [[coroutine]]-like functionality is provided in 2.5, by extending Python's [[generator (computer science)|generators]].<ref>{{ cite web | url = http://www.python.org/peps/pep-0342.html | title = Coroutines via Enhanced Generators | date = [[21 April]] [[2006]] | first = Guido | last = van Rossum | coauthors = Phillip J. Eby | work = Python Enhancement Proposals | publisher = Python Foundation | accessdate = 2007-03-21 }}</ref> Prior to 2.5, generators were [[lazy evaluation|lazy]] [[iterator]]s &mdash; information was passed unidirectionally out of the generator. As of Python 2.5, it is possible to pass information back into a generator function.
Python's [[expression (computer science)|expressions]] include:
* The <code>+</code>, <code>-</code>, and <code>*</code> operators for mathematical addition, subtraction, and multiplication are similar to other languages, but the behavior of division differs. There are two types of divisions in Python: [[floor division]] (or integer division) <code>//</code> and floating-point<code>/</code>division.<ref>{{cite web|title=division|url=https://docs.python.org|website=python.org|access-date=30 July 2014|archive-date=20 July 2006|archive-url=https://web.archive.org/web/20060720033244/http://docs.python.org/|url-status=live}}</ref> Python uses the <code>**</code> operator for exponentiation.
* Python uses the <code>+</code> operator for string concatenation. Python uses the <code>*</code> operator for duplicating a string a specified number of times.
* The <code>@</code> infix operator<!-- was introduced in Python 3.5-->. It is intended to be used by libraries such as [[NumPy]] for [[matrix multiplication]].<ref name=PEP465>{{cite web |title=PEP 0465 – A dedicated infix operator for matrix multiplication |url=https://www.python.org/dev/peps/pep-0465/ |website=python.org |access-date=1 January 2016 |archive-date=4 June 2020 |archive-url=https://web.archive.org/web/20200604224255/https://www.python.org/dev/peps/pep-0465/ |url-status=live}}</ref><ref name=Python3.5Changelog>{{cite web |title=Python 3.5.1 Release and Changelog |url=https://www.python.org/downloads/release/python-351/ |website=python.org |access-date=1 January 2016 |archive-date=14 May 2020 |archive-url=https://web.archive.org/web/20200514034938/https://www.python.org/downloads/release/python-351/ |url-status=live}}</ref>
* The syntax <code>:=</code>, called the "walrus operator", was introduced in Python 3.8. It assigns values to variables as part of a larger expression.<ref name=Python3.8Changelog>{{cite web |title=What's New in Python 3.8 |url=https://docs.python.org/3.8/whatsnew/3.8.html |access-date=14 October 2019 |archive-date=8 June 2020 |archive-url=https://web.archive.org/web/20200608124345/https://docs.python.org/3.8/whatsnew/3.8.html |url-status=live}}</ref>
* In Python, <code>==</code> compares by value. Python's <code>is</code> operator may be used to compare object identities (comparison by reference), and comparisons may be chained—for example, {{code|lang=python|code=a <= b <= c}}.
* Python uses <code>and</code>, <code>or</code>, and <code>not</code> as Boolean operators.
* Python has a type of expression named a ''[[List comprehension#Python|list comprehension]]'', and a more general expression named a ''[[Generator (computer programming)|generator]] expression''.<ref name="AutoNT-59"/>
* [[Anonymous function]]s are implemented using [[Lambda (programming)|lambda expressions]]; however, there may be only one expression in each body.
* Conditional expressions are written as {{code|lang=python|code=x if c else y}}<ref name="AutoNT-60"/> (different in order of operands from the <code>[[?:|c ? x : y]]</code> operator common to many other languages).
* Python makes a distinction between [[list (computer science)|lists]] and [[tuple]]s. Lists are written as {{code|lang=python|code=[1, 2, 3]}}, are mutable, and cannot be used as the keys of dictionaries (dictionary keys must be [[immutable]] in Python). Tuples, written as {{code|lang=python|code=(1, 2, 3)}}, are immutable and thus can be used as keys of dictionaries, provided all of the tuple's elements are immutable. The <code>+</code> operator can be used to concatenate two tuples, which does not directly modify their contents, but produces a new tuple containing the elements of both. Thus, given the variable <code>t</code> initially equal to {{code|lang=python|code=(1, 2, 3)}}, executing {{code|lang=python|code=t = t + (4, 5)}} first evaluates {{code|lang=python|code=t + (4, 5)}}, which yields {{code|lang=python|code=(1, 2, 3, 4, 5)}}, which is then assigned back to <code>t</code>—thereby effectively "modifying the contents" of <code>t</code> while conforming to the immutable nature of tuple objects. Parentheses are optional for tuples in unambiguous contexts.<ref>{{cite web|title=4. Built-in Types – Python 3.6.3rc1 documentation|url=https://docs.python.org/3/library/stdtypes.html#tuple|website=python.org|access-date=1 October 2017|archive-date=14 June 2020|archive-url=https://web.archive.org/web/20200614194325/https://docs.python.org/3/library/stdtypes.html#tuple|url-status=live}}</ref>
* Python features ''sequence unpacking'' where multiple expressions, each evaluating to anything that can be assigned (to a variable, writable property, etc.) are associated in an identical manner to that forming tuple literals—and, as a whole, are put on the left-hand side of the equal sign in an assignment statement. The statement expects an ''iterable'' object on the right-hand side of the equal sign that produces the same number of values as the provided writable expressions; when iterated through them, it assigns each of the produced values to the corresponding expression on the left.<ref>{{cite web|title=5.3. Tuples and Sequences – Python 3.7.1rc2 documentation|url=https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences|website=python.org|access-date=17 October 2018|archive-date=10 June 2020|archive-url=https://web.archive.org/web/20200610050047/https://docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences|url-status=live}}</ref>
* Python has a "string format" operator <code>%</code> that functions analogously to <code>[[printf format string|printf]]</code> format strings in C—e.g. {{code|2=python|1="spam=%s eggs=%d" % ("blah", 2)}} evaluates to <code>"spam=blah eggs=2"</code>. In Python&nbsp;2.6+ and 3+, this was supplemented by the <code>format()</code> method of the <code>str</code> class, e.g. {{code|2=python|1="spam={0} eggs={1}".format("blah", 2)}}. Python&nbsp;3.6 added "f-strings": {{code|2=python|1=spam = "blah"; eggs = 2; f'spam={spam} eggs={eggs}'}}.<ref name="pep-0498">{{cite web |title=PEP 498 – Literal String Interpolation |url=https://www.python.org/dev/peps/pep-0498/ |website=python.org |access-date=8 March 2017 |archive-date=15 June 2020 |archive-url=https://web.archive.org/web/20200615184141/https://www.python.org/dev/peps/pep-0498/ |url-status=live}}</ref>
* Strings in Python can be [[concatenation|concatenated]] by "adding" them (with the same operator as for adding integers and floats), e.g. {{code|2=python|1="spam" + "eggs"}} returns <code>"spameggs"</code>. If strings contain numbers, they are added as strings rather than integers, e.g. {{code|2=python|1="2" + "2"}} returns <code>"22"</code>.
* Python has various [[string literal]]s:
** Delimited by single or double quotes; unlike in [[Unix shell]]s, [[Perl]], and Perl-influenced languages, single and double quotes work the same. Both use the backslash (<code>\</code>) as an [[escape character]]. [[String interpolation]] became available in Python&nbsp;3.6 as "formatted string literals".<ref name="pep-0498"/>
** Triple-quoted (beginning and ending with three single or double quotes), which may span multiple lines and function like [[here document]]s in shells, Perl, and [[Ruby (programming language)|Ruby]].
** [[Raw string]] varieties, denoted by prefixing the string literal with <code>r</code>. Escape sequences are not interpreted; hence raw strings are useful where literal backslashes are common, such as [[regular expression]]s and [[Microsoft Windows|Windows]]-style paths. (Compare "<code>@</code>-quoting" in [[C Sharp (programming language)|C#]].)
* Python has [[array index]] and [[array slicing]] expressions in lists, denoted as <code>a[key]</code>, {{code|lang=python|code=a[start:stop]}} or {{code|lang=python|code=a[start:stop:step]}}. Indexes are [[zero-based numbering|zero-based]], and negative indexes are relative to the end. Slices take elements from the ''start'' index up to, but not including, the ''stop'' index. The third slice parameter, called ''step'' or ''stride'', allows elements to be skipped and reversed. Slice indexes may be omitted—for example, {{code|lang=python|code=a[:]}} returns a copy of the entire list. Each element of a slice is a [[shallow copy]].

In Python, a distinction between expressions and statements is rigidly enforced, in contrast to languages such as [[Common Lisp]], [[Scheme (programming language)|Scheme]], or [[Ruby (programming language)|Ruby]]. This leads to duplicating some functionality. For example:
* [[List comprehensions]] vs. <code>for</code>-loops
* [[Conditional (programming)|Conditional]] expressions vs. <code>if</code> blocks
* The <code>eval()</code> vs. <code>exec()</code> built-in functions (in Python&nbsp;2, <code>exec</code> is a statement); the former is for expressions, the latter is for statements

Statements cannot be a part of an expression—so list and other comprehensions or [[Lambda (programming)|lambda expressions]], all being expressions, cannot contain statements. A particular case is that an assignment statement such as {{code|lang=python|code=a = 1}} cannot form part of the conditional expression of a conditional statement.


===Methods===
===Methods===
[[Method (programming)|Method]]s on objects are [[function (programming)|function]]s attached to the object's class; the syntax <code>instance.method(argument)</code> is, for normal methods and functions, [[syntactic sugar]] for <code>Class.method(instance, argument)</code>. Python methods have an explicit <code>[[This (computer science)|self]]</code> parameter to access [[instance data]], in contrast to the implicit self in some other object-oriented programming languages (for example, [[Java (programming language)|Java]], [[C++]] or [[Ruby (programming language)|Ruby]]).<ref>{{ cite web | url = http://www.python.org/doc/faq/general/#why-must-self-be-used-explicitly-in-method-definitions-and-calls | title = Why must 'self' be used explicitly in method definitions and calls? | work = Python FAQ | publisher = Python Foundation }}</ref>
[[Method (programming)|Methods]] on objects are [[function (programming)|functions]] attached to the object's class; the syntax {{code|lang=python|code=instance.method(argument)}} is, for normal methods and functions, [[syntactic sugar]] for {{code|lang=python|code=Class.method(instance, argument)}}. Python methods have an explicit <code>[[this (computer programming)|self]]</code> parameter to access [[instance data]], in contrast to the implicit self (or <code>this</code>) in some other object-oriented programming languages (e.g., [[C++]], Java, [[Objective-C]], [[Ruby (programming language)|Ruby]]).<ref name="AutoNT-61"/> Python also provides methods, often called ''dunder methods'' (due to their names beginning and ending with double-underscores), to allow user-defined classes to modify how they are handled by native operations including length, comparison, in [[arithmetic operations]] and type conversion.<ref>{{cite book |last1=Sweigart |first1=Al |title=Beyond the Basic Stuff with Python: Best Practices for Writing Clean Code |year=2020 |publisher=No Starch Press |isbn=978-1-59327-966-0 |page=322 |url=https://books.google.com/books?id=7GUKEAAAQBAJ&pg=PA322 |language=en |access-date=7 July 2021 |archive-date=13 August 2021 |archive-url=https://web.archive.org/web/20210813194312/https://books.google.com/books?id=7GUKEAAAQBAJ&pg=PA322 |url-status=live}}</ref>


===Typing===
===Typing===
[[File:Python 3. The standard type hierarchy-en.svg|thumb|The standard type hierarchy in Python&nbsp;3]]
Python uses [[duck typing]] and has typed objects but untyped variable names. Type constraints are not checked at [[compile time]]; rather, operations on an object may fail, signifying that the given object is not of a suitable type. Despite not enforcing [[static typing]], Python is [[strongly typed]], forbidding nonsense operations (for example, adding a number to a string) rather than silently attempting to make sense of them.
Python uses [[duck typing]] and has typed objects but untyped variable names. Type constraints are not checked at [[compile time]]; rather, operations on an object may fail, signifying that it is not of a suitable type. Despite being [[Type system#Dynamic type checking and runtime type information|dynamically typed]], Python is [[strong and weak typing|strongly typed]], forbidding operations that are not well-defined (for example, adding a number to a string) rather than silently attempting to make sense of them.


Python allows programmers to define their own types using [[class (computer science)|classes]], most often used for [[object-oriented programming]]. New [[object (computer science)|instances]] of classes are constructed by calling the class (for example, {{code|lang=python|code=SpamClass()}} or {{code|lang=python|code=EggsClass()}}), and the classes are instances of the [[metaclass]] <code>type</code> (itself an instance of itself), allowing metaprogramming and [[Reflective programming|reflection]].
{| class="wikitable"

Before version&nbsp;3.0, Python had two kinds of classes (both using the same syntax): ''old-style'' and ''new-style'';<ref name="classy"/> current Python versions only support the semantics of the new style.

Python supports [[optional typing|optional type annotations]].<ref name="type_hint-PEP"/><ref>{{Cite web |title=PEP 484 – Type Hints {{!}} peps.python.org |url=https://peps.python.org/pep-0484/ |access-date=2023-11-29 |website=peps.python.org |archive-date=27 November 2023 |archive-url=https://web.archive.org/web/20231127205023/https://peps.python.org/pep-0484/ |url-status=live}}</ref> These annotations are not enforced by the language, but may be used by external tools such as mypy to catch errors.<ref>{{cite web |title=typing — Support for type hints |url=https://docs.python.org/3/library/typing.html |website=Python documentation |publisher=Python Software Foundation |access-date=22 December 2023 |archive-date=21 February 2020 |archive-url=https://web.archive.org/web/20200221184042/https://docs.python.org/3/library/typing.html |url-status=live}}</ref><ref>{{cite web |url=http://mypy-lang.org/ |title=mypy – Optional Static Typing for Python |access-date=28 January 2017 |archive-date=6 June 2020 |archive-url=https://web.archive.org/web/20200606192012/http://mypy-lang.org/ |url-status=live}}</ref> Mypy also supports a Python compiler called mypyc, which leverages type annotations for optimization.<ref>{{cite web |title=Introduction |url=https://mypyc.readthedocs.io/en/latest/introduction.html |website=mypyc.readthedocs.io |access-date=22 December 2023 |archive-date=22 December 2023 |archive-url=https://web.archive.org/web/20231222000457/https://mypyc.readthedocs.io/en/latest/introduction.html |url-status=live}}</ref>

{|class="wikitable"
|+ Summary of Python 3's built-in types
|-
! Type
! Type
! [[immutable object|Mutability]]
! Description
! Description
! Syntax Example
! Syntax examples
|-
|-
| <code>[[string (computer science)|str]]</code>, <code>[[unicode]]</code>
| <code>bool</code>
| immutable
| An [[Immutable object|immutable]] sequence of characters
| [[Boolean value]]
| <code>'Wikipedia'</code>, <code>u'Wikipedia'</code>
| {{code|lang=python|True}}<br/>{{code|lang=python|False}}
|-
|-
| <code>[[list (computer science)|list]]</code>
| <code>bytearray</code>
| mutable
| [[Immutable object|Mutable]], can contain mixed types
| Sequence of [[byte]]s
| <code>[4.0, 'string', True]</code>
| {{code|lang=python|bytearray(b'Some ASCII')}}<br/>{{code|lang=python|bytearray(b"Some ASCII")}}<br/>{{code|lang=python|bytearray([119, 105, 107, 105])}}
|-
|-
| <code>[[tuple]]</code>
| <code>bytes</code>
| immutable
| [[Immutable object|Immutable]], can contain mixed types
| Sequence of bytes
| <code>(4.0, 'string', True)</code>
| {{code|lang=python|b'Some ASCII'}}<br/>{{code|lang=python|b"Some ASCII"}}<br/>{{code|lang=python|bytes([119, 105, 107, 105])}}
|-
|-
| <code>[[set (computer science)|set]]</code>, <code>frozenset</code>
| <code>complex</code>
| immutable
| Unordered, contains no duplicates
| [[Complex number]] with real and imaginary parts
| <code>set([4.0, 'string', True])</code><br /><code>frozenset([4.0, 'string', True])</code>
| {{code|lang=python|3+2.7j}}<br/>{{code|lang=python|3 + 2.7j}}
|-
|-
| <code>[[associative array|dict]]</code>
| <code>dict</code>
| mutable
| Group of key and value pairs
| [[Associative array]] (or dictionary) of key and value pairs; can contain mixed types (keys and values), keys must be a hashable type
| <code>{'key1': 1.0, 'key2': False}</code>
| {{code|lang=python|{'key1': 1.0, 3: False} }}<br/>{{code|lang=python| {} }}
|-
|-
| <code>[[integer (computer science)|int]]</code>
| <code>types.EllipsisType</code>
| immutable
| A [[fixed precision]] number<br />(will be transparently expanded to an unlimited precision <code>long</code>, when it overflows the storage for an integer.)
| An [[Ellipsis (programming operator)|ellipsis]] placeholder to be used as an index in [[NumPy]] arrays
| <code>42</code><br /><code>2147483648L</code>
| {{code|lang=python|...}}<br/>{{code|lang=python|Ellipsis}}
|-
|-
| <code>[[floating point|float]]</code>
| <code>float</code>
| immutable
| A [[real number]]
| [[Double-precision floating-point format|Double-precision]] [[floating-point arithmetic|floating-point number]]. The precision is machine-dependent but in practice is generally implemented as a 64-bit [[IEEE&nbsp;754]] number with 53&nbsp;bits of precision.<ref>{{Cite web
| <code>3.1415927</code>
|title=15. Floating Point Arithmetic: Issues and Limitations – Python 3.8.3 documentation
|url=https://docs.python.org/3.8/tutorial/floatingpoint.html#representation-error
|access-date=6 June 2020
|website=docs.python.org
|quote=Almost all machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 "double precision".
|archive-date=6 June 2020
|archive-url=https://web.archive.org/web/20200606113842/https://docs.python.org/3.8/tutorial/floatingpoint.html#representation-error
|url-status=live
}}</ref>
|
{{code|lang=python|1.33333}}
|-
|-
| <code>[[complex number|complex]]</code>
| <code>frozenset</code>
| immutable
| A [[complex number]] with real number and imaginary parts
| Unordered [[set (computer science)|set]], contains no duplicates; can contain mixed types, if hashable
| <code>3+2j</code>
| {{nobr|{{code|lang=python|frozenset([4.0, 'string', True])}}}}
|-
|-
|<code>[[truth value|bool]]</code>
| <code>int</code>
| immutable
| truth value
| [[Integer (computer science)|Integer]] of unlimited magnitude<ref name="pep0237"/>
|<code>True</code> or <code>False</code>
| {{code|lang=python|42}}
|-
| <code>list</code>
| mutable
| [[list (computer science)|List]], can contain mixed types
| {{code|lang=python|[4.0, 'string', True]}}<br/>{{code|lang=python|[]}}
|-
| <code>types.NoneType</code>
| immutable
| An object representing the absence of a value, often called [[null pointer|null]] in other languages
| {{code|lang=python|None}}
|-
| <code>types.NotImplementedType</code>
| immutable
| A placeholder that can be returned from [[Operator overloading|overloaded operators]] to indicate unsupported operand types.
| {{code|lang=python|NotImplemented}}
|-
| <code>range</code>
| immutable
| An ''immutable sequence'' of numbers commonly used for looping a specific number of times in <code>for</code> loops<ref>{{cite web |title=Built-in Types |url=https://docs.python.org/3/library/stdtypes.html#typesseq-range |access-date=3 October 2019 |archive-date=14 June 2020 |archive-url=https://web.archive.org/web/20200614194325/https://docs.python.org/3/library/stdtypes.html#typesseq-range |url-status=live}}</ref>
| {{code|lang=python|range(-1, 10)}}<br/>{{code|lang=python|range(10, -5, -2)}}
|-
| <code>set</code>
| mutable
| Unordered [[set (computer science)|set]], contains no duplicates; can contain mixed types, if hashable
| {{code|lang=python| {4.0, 'string', True} }}<br/>{{code|lang=python|set()}}
|-
| <code>str</code>
| immutable
| A [[string (computer science)|character string]]: sequence of Unicode codepoints
| {{code|lang=python|'Wikipedia'}}<br/>{{code|lang=python|"Wikipedia"}}<syntaxhighlight lang="python">"""Spanning
multiple
lines"""</syntaxhighlight><syntaxhighlight lang="python">
Spanning
multiple
lines
</syntaxhighlight>
|-
| <code>tuple</code>
| immutable
| Can contain mixed types
| {{code|lang=python|(4.0, 'string', True)}}<br/>{{code|lang=python|('single element',)}}<br/>{{code|lang=python|()}}
|}
|}


===Arithmetic operations===
Python also allows programmers to define their own types. This is done using [[class (computer science)|class]]es, which are most often used for an [[object-oriented]] style of programming. New [[instance (programming)|instance]]s of classes are constructed by calling the class (eg, <code>FooClass()</code>), and the classes themselves are instances of the class <code>type</code> (itself an instance of itself), allowing [[metaprogramming]] and [[reflection (programming)|reflection]].
Python has the usual symbols for arithmetic operators (<code>+</code>, <code>-</code>, <code>*</code>, <code>/</code>), the floor division operator <code>//</code> and the [[modulo operation]] <code>%</code> (where the remainder can be negative,<!--unlike in C language depending on compiler,<ref>{{Cite web|url=https://stackoverflow.com/questions/11720656/modulo-operation-with-negative-numbers/42131603|title=c – Modulo operation with negative numbers|quote=Note that, in C89, whether the result round upward or downward is implementation-defined.|website=Stack Overflow|access-date=25 September 2019}}</ref>--> e.g. <code>4 % -3 == -2</code>). It also has <code>**</code> for [[exponentiation]], e.g. <code>5**3 == 125</code> and <code>9**0.5 == 3.0</code>, and a matrix‑multiplication operator <code>@</code> .<ref>{{cite web |url=https://legacy.python.org/dev/peps/pep-0465/ |title=PEP 465 – A dedicated infix operator for matrix multiplication |work=python.org |access-date=3 July 2018 |archive-date=29 May 2020 |archive-url=https://web.archive.org/web/20200529200310/https://legacy.python.org/dev/peps/pep-0465/ |url-status=live}}</ref> These operators work like in traditional math; with the same [[order of operations|precedence rules]], the operators [[Infix notation|infix]] (<code>+</code> and <code>-</code> can also be [[unary operation|unary]] to represent positive and negative numbers respectively).

The division between integers produces floating-point results. The behavior of division has changed significantly over time:<ref name="pep0238"/>
* Current Python (i.e. since 3.0) changed <code>/</code> to always be floating-point division, e.g. {{code|class=nowrap|2=python|1=5/2 == 2.5}}.
* The floor division <code>//</code> operator was introduced. So <code>7//3 == 2</code>, <code>-7//3 == -3</code>, <code>7.5//3 == 2.0</code> and <code>-7.5//3 == -3.0</code>. Adding {{code|class=nowrap|2=python2|1=from __future__ import division}} causes a module used in Python 2.7 to use Python&nbsp;3.0 rules for division (see above).

In Python terms, <code>/</code> is ''true division'' (or simply ''division''), and <code>//</code> is ''floor division.'' <code>/</code> before version 3.0 is ''classic division''.<ref name="pep0238"/>

Rounding towards negative infinity, though different from most languages, adds consistency. For instance, it means that the equation {{code|class=nowrap|2=python|1=(a + b)//b == a//b + 1}} is always true. It also means that the equation {{code|class=nowrap|2=python|1=b*(a//b) + a%b == a}} is valid for both positive and negative values of <code>a</code>. However, maintaining the validity of this equation means that while the result of <code>a%b</code> is, as expected, in the [[half-open interval]] [0, ''b''), where <code>b</code> is a positive integer, it has to lie in the interval (''b'', 0] when <code>b</code> is negative.<ref name="AutoNT-62"/>

Python provides a <code>round</code> function for [[rounding]] a float to the nearest integer. For [[Rounding#Tie-breaking|tie-breaking]], Python&nbsp;3 uses [[round to even]]: <code>round(1.5)</code> and <code>round(2.5)</code> both produce <code>2</code>.<ref name="AutoNT-64"/> Versions before 3 used [[Rounding#Rounding away from zero|round-away-from-zero]]: <code>round(0.5)</code> is <code>1.0</code>, <code>round(-0.5)</code> is <code>−1.0</code>.<ref name="AutoNT-63"/>

Python allows Boolean expressions with multiple equality relations in a manner that is consistent with general use in mathematics. For example, the expression <code>a < b < c</code> tests whether <code>a</code> is less than <code>b</code> and <code>b</code> is less than <code>c</code>.<ref name="AutoNT-65"/> C-derived languages interpret this expression differently: in C, the expression would first evaluate <code>a < b</code>, resulting in 0 or 1, and that result would then be compared with <code>c</code>.<ref name="CPL"/>

Python uses [[arbitrary-precision arithmetic]] for all integer operations. The <code>Decimal</code> type/class in the <code>decimal</code> module provides [[decimal floating point|decimal floating-point numbers]] to a pre-defined arbitrary precision and several rounding modes.<ref name="AutoNT-88"/> The <code>Fraction</code> class in the <code>fractions</code> module provides arbitrary precision for [[rational number]]s.<ref>{{cite web|title=What's New in Python 2.6 |url=https://docs.python.org/2.6/whatsnew/2.6.html|website=Python v2.6.9 documentation |date=Oct 29, 2013 |access-date=26 September 2015|archive-date=23 December 2019|archive-url=https://web.archive.org/web/20191223213856/https://docs.python.org/2.6/whatsnew/2.6.html|url-status=live}}</ref>

Due to Python's extensive mathematics library, and the third-party library [[NumPy]] that further extends the native capabilities, it is frequently used as a scientific scripting language to aid in problems such as numerical data processing and manipulation.<ref>{{Cite web|url=https://www.stat.washington.edu/~hoytak/blog/whypython.html|title=10 Reasons Python Rocks for Research (And a Few Reasons it Doesn't) – Hoyt Koepke|website=University of Washington Department of Statistics |access-date=3 February 2019|archive-date=31 May 2020|archive-url=https://web.archive.org/web/20200531211840/https://www.stat.washington.edu/~hoytak/blog/whypython.html|url-status=dead}}</ref><ref>{{Cite web|url=https://engineering.ucsb.edu/~shell/che210d/python.pdf|title=An introduction to Python for scientific computing|last=Shell|first=Scott|date=17 June 2014|access-date=3 February 2019|archive-date=4 February 2019|archive-url=https://web.archive.org/web/20190204014642/https://engineering.ucsb.edu/~shell/che210d/python.pdf|url-status=live}}</ref>

==Programming examples==
[["Hello, World!" program]]:
<syntaxhighlight lang="python">
print('Hello, world!')
</syntaxhighlight>

Program to calculate the [[factorial]] of a positive integer:
<syntaxhighlight lang="python" line="1">
n = int(input('Type a number, and its factorial will be printed: '))

if n < 0:
raise ValueError('You must enter a non-negative integer')

factorial = 1
for i in range(2, n + 1):
factorial *= i

print(factorial)
</syntaxhighlight><!--

Please don’t add more examples.

-->

==Libraries==
Python's large standard library<ref name="AutoNT-86"/> provides tools suited to many tasks and is commonly cited as one of its greatest strengths. For Internet-facing applications, many standard formats and protocols such as [[MIME]] and [[Hypertext Transfer Protocol|HTTP]] are supported. It includes modules for creating [[graphical user interface]]s, connecting to [[relational database]]s, [[pseudorandom number generator|generating pseudorandom numbers]], arithmetic with arbitrary-precision decimals,<ref name="AutoNT-88"/> manipulating [[regular expression]]s, and [[unit testing]].

Some parts of the standard library are covered by specifications—for example, the [[Web Server Gateway Interface]] (WSGI) implementation <code>wsgiref</code> follows PEP 333<ref name="AutoNT-89"/>—but most are specified by their code, internal documentation, and [[test suite]]s. However, because most of the standard library is cross-platform Python code, only a few modules need altering or rewriting for variant implementations.

{{As of|2024|03|17|post=,}} the [[Python Package Index]] (PyPI), the official repository for third-party Python software, contains over 523,000<ref name="PyPI">{{cite web |date=2024-03-17 |title=PyPI |url=https://pypi.org/ |url-status=live |archive-url=https://web.archive.org/web/20240317112557/https://pypi.org/ |archive-date=2024-03-17 |website=PyPI}}</ref> packages with a wide range of functionality, including:

{{columns-list|colwidth=30em|
* [[Automation]]
* [[Data analytics]]
* [[Database]]s
* [[Documentation]]
* [[Graphical user interface]]s
* [[Image processing]]
* [[Machine learning]]
* [[Mobile app]]s
* [[Multimedia]]
* [[Computer networking]]
* [[Scientific computing]]
* [[System administration]]
* [[Test framework]]s
* [[Text processing]]
* [[Web framework]]s
* [[Web scraping]]
}}

==Development environments==
{{See also|Comparison of integrated development environments#Python}}

Most Python implementations (including CPython) include a [[read–eval–print loop]] (REPL), permitting them to function as a [[command line interpreter]] for which users enter statements sequentially and receive results immediately.

Python also comes with an [[Integrated development environment|Integrated development environment (IDE)]] called [[IDLE]], which is more beginner-oriented.

Other shells, including [[IDLE]] and [[IPython]], add further abilities such as improved auto-completion, session state retention, and [[syntax highlighting]].

As well as standard desktop [[integrated development environment]]s including PyCharm, IntelliJ Idea, Visual Studio Code etc, there are [[web browser]]-based IDEs, including [[SageMath]], for developing science- and math-related programs; [[PythonAnywhere]], a browser-based IDE and hosting environment; and Canopy IDE, a commercial IDE emphasizing [[scientific computing]].<ref>{{cite web|last1=Enthought|first1=Canopy|title=Canopy|url=https://www.enthought.com/products/canopy/|website=www.enthought.com|access-date=20 August 2016|archive-date=15 July 2017|archive-url=https://web.archive.org/web/20170715151703/https://www.enthought.com/products/canopy/|url-status=dead}}</ref>


==Implementations==
==Implementations==
{{See also|List of Python software#Python implementations}}
The mainstream Python implementation, also known as ''[[CPython]]'', is written in [[C (programming language)|C]] meeting the [[C89 (C version)|C89]] standard,<ref>[http://www.python.org/dev/peps/pep-0007/ PEP 7 - Style Guide for C Code<!-- Bot generated title -->]</ref>. CPython compiles the Python program into intermediate byte code<ref>[http://docs.python.org/lib/bytecodes.html CPython byte code]</ref>, which is then executed by the virtual machine<ref>[http://www.troeger.eu/teaching/pythonvm08.pdf Python 2.5 internals]</ref>. It is distributed with a large standard library written in a mixture of C and Python. CPython ships in versions for many platforms, including [[Microsoft Windows]] and most modern [[Unix-like]] systems. CPython was intended from almost its very conception to be cross-platform; its use and development on esoteric platforms such as Amoeba, alongside more conventional ones like [[Unix]], or [[Macintosh]] has greatly helped in this regard.<ref>[http://www.oreilly.com/pub/a/oreilly/frank/rossum_1099.html O'Reilly - An Interview with Guido van Rossum<!-- Bot generated title -->]</ref>


===Reference implementation===
[[Stackless Python]] is a significant fork of CPython that implements [[microthread]]s; it does not use the C memory stack. CPython uses a GIL to allow only one thread to execute at a time while the Stackless Python threads are independent of the OS and can run concurrently. Stackless Python is better suited to scalable tasks and for use on microcontrollers or other limited resource platforms due to the threads light weight. It can be expected to run on approximately the same platforms that CPython runs on.
[[CPython]] is the [[reference implementation]] of Python. It is written in C, meeting the [[C89 (C version)|C89]] standard (Python 3.11 uses [[C11 (C standard revision)|C11]]<ref>{{Cite web |title=PEP 7 – Style Guide for C Code {{!}} peps.python.org |url=https://peps.python.org/pep-0007/ |access-date=2022-04-28 |website=peps.python.org |archive-date=24 April 2022 |archive-url=https://web.archive.org/web/20220424202827/https://peps.python.org/pep-0007/ |url-status=live}}</ref>) with several select [[C99]] features. CPython includes its own C extensions, but third-party extensions are not limited to older C versions—e.g. they can be implemented with [[C11 (C standard revision)|C11]] or C++.<ref>{{Cite web|title=4. Building C and C++ Extensions – Python 3.9.2 documentation|url=https://docs.python.org/3/extending/building.html|access-date=2021-03-01|website=docs.python.org|archive-date=3 March 2021|archive-url=https://web.archive.org/web/20210303002519/https://docs.python.org/3/extending/building.html|url-status=live}}</ref><ref name="AutoNT-66"/> CPython [[Compiler|compiles]] Python programs into an intermediate [[bytecode]]<ref name="AutoNT-67"/> which is then executed by its [[virtual machine]].<ref name="AutoNT-68"/> CPython is distributed with a large standard library written in a mixture of C and native Python, and is available for many platforms, including Windows (<!--"Windows Vista support dropped in Python 3.7"-->starting with Python&nbsp;3.9, the Python installer deliberately fails to install on [[Windows 7]] and 8;<ref>{{Cite web|title=Changelog – Python 3.9.0 documentation|url=https://docs.python.org/release/3.9.0/whatsnew/changelog.html#changelog|access-date=2021-02-08|website=docs.python.org|archive-date=7 February 2021|archive-url=https://web.archive.org/web/20210207001142/https://docs.python.org/release/3.9.0/whatsnew/changelog.html#changelog|url-status=live}}</ref><ref>{{Cite web|title=Download Python|url=https://www.python.org/downloads/release/python-391|access-date=2020-12-13|website=Python.org|language=en|archive-date=8 December 2020|archive-url=https://web.archive.org/web/20201208045225/https://www.python.org/downloads/release/python-391/|url-status=live}}</ref> [[Windows XP]] was supported until Python&nbsp;3.5<!--"Windows XP support dropped in Python 3.5"-->) and most modern [[Unix-like]] systems, including macOS (and [[Apple M1]] Macs, since Python&nbsp;3.9.1, with experimental installer), with unofficial support for [[OpenVMS|VMS]].<!--"Put online a new version of Python 3.10.0a (IA64only)"--><ref>{{Cite web|title=history [vmspython]|url=https://www.vmspython.org/doku.php?id=history|access-date=2020-12-04|website=www.vmspython.org|archive-date=2 December 2020|archive-url=https://web.archive.org/web/20201202194743/https://www.vmspython.org/doku.php?id=history|url-status=live}}</ref> Platform portability was one of its earliest priorities.<ref name="AutoNT-69"/> (During Python&nbsp;1 and 2 development, even [[OS/2]] and [[Solaris (operating system)|Solaris]] were supported,<!-- Also python-3.2.2 at http://unixpackages.com/packages/package-list --><ref>{{Cite web|title=Download Python for Other Platforms|url=https://www.python.org/download/other/|access-date=2020-12-04|website=Python.org|language=en|archive-date=27 November 2020|archive-url=https://web.archive.org/web/20201127015815/https://www.python.org/download/other/|url-status=live}}</ref> but support has since been dropped for many platforms.)<!--


Include more, here or in the infobox? I find e.g.:
[[Jython]] compiles the Python program into Java byte code, which can then be executed by every [[Java Virtual Machine]] implementation. This also enables the utilization of Java class library functions from the Python program. [[IronPython]] follows a similar approach in order to run Python programs on the .NET [[Common Language Runtime]].
best-effort support:


Android API 24
[[PyPy]] is an experimental [[self-hosting]] implementation of Python, written in Python, that can output several types of [[bytecode]], [[object code]] and [[intermediate language]]s.


and also:
Several programs exist to package the Python interpreter with application programs (or scripts) as standalone UNIX, Linux, Windows or Mac OS X executables, including [http://wiki.python.org/moin/Freeze Freeze], a pure Python utility that ships with Python, or [http://www.py2exe.org/ py2exe], [http://pyinstaller.python-hosting.com/ PyInstaller], [http://python.net/crew/atuining/cx_Freeze/ cx_Freeze] and [http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html py2app], all of which are available separately. Many third-party libraries for Python (and even some first-party ones) are only available on Windows, Linux, BSD, and Mac OS X.


Starting with CPython 3.7.0, *nix platforms are expected to provide at least one of C.UTF-8 (full locale), C.utf8 (full locale) or UTF-8 (LC_CTYPE-only locale) as an alternative to the legacy C locale.
In 2005 [[Nokia]] released a Python interpreter for the [[Series 60]] [[mobile phone]]s called [[PyS60]]. It includes many of the modules from the CPython implementations, but also some additional modules for integration with the [[Symbian]] operating system. This project has been kept up to date to run on all variants of the S60 platform and there are several third party modules available such as [http://pdis.hiit.fi/pdis/download/miso/ Miso] and [http://cyke64.googlepages.com/ uitricks].
-->


Python, since 3.7, only supports operating systems with multi-threading support.
''[http://www.chinesepython.org/cgi_bin/cgb.cgi/english/english.html ChinesePython]'' (中蟒) is a Python programming language using Chinese language lexicon. Besides reserved words and variable names, most data type operations can be coded in Chinese as well.


===Other implementations===
===Interpretational semantics===
* [[PyPy]] is a fast, compliant interpreter of Python&nbsp;2.7 and 3.8.<ref name="AutoNT-70"/><ref>{{Cite web|last=Team|first=The PyPy|date=2019-12-28|title=Download and Install|url=https://www.pypy.org/download.html|access-date=2022-01-08|website=PyPy|language=en|archive-date=8 January 2022|archive-url=https://web.archive.org/web/20220108212951/https://www.pypy.org/download.html|url-status=live}}</ref> Its [[Just-in-time compilation|just-in-time compiler]] often brings a significant speed improvement over CPython, but some libraries written in C cannot be used with it.<ref name="AutoNT-71"/>
<!-- Deleted image removed: [[Image:IDLE Windows.png|thumb|379px|CPython's interactive mode, used via IDLE]] -->
* [[Stackless Python]] is a significant fork of CPython that implements [[microthread]]s; it does not use the [[call stack]] in the same way, thus allowing massively concurrent programs. PyPy also has a stackless version.<ref name="AutoNT-73"/>
* [[MicroPython]] and [[CircuitPython]] are Python&nbsp;3 variants optimized for [[microcontroller]]s, including [[Lego Mindstorms EV3]].<ref>{{Cite web|url=https://education.lego.com/en-us/support/mindstorms-ev3/python-for-ev3|title=Python-for-EV3|website=LEGO Education|language=en|access-date=17 April 2019|archive-date=7 June 2020|archive-url=https://web.archive.org/web/20200607234814/https://education.lego.com/en-us/support/mindstorms-ev3/python-for-ev3|url-status=live}}</ref>
* Pyston is a variant of the Python runtime that uses just-in-time compilation to speed up the execution of Python programs.<ref>{{cite news|url=https://www.infoworld.com/article/3587591/pyston-returns-from-the-dead-to-speed-python.html|title=Pyston returns from the dead to speed Python|last=Yegulalp|first=Serdar|date=29 October 2020|website=[[InfoWorld]]|access-date=26 January 2021|archive-date=27 January 2021|archive-url=https://web.archive.org/web/20210127113233/https://www.infoworld.com/article/3587591/pyston-returns-from-the-dead-to-speed-python.html|url-status=live}}</ref>
* Cinder is a performance-oriented fork of CPython 3.8 that contains a number of optimizations, including bytecode inline caching, eager evaluation of coroutines, a method-at-a-time [[Just-in-time compilation|JIT]], and an experimental bytecode compiler.<ref>{{Cite web|url=https://github.com/facebookincubator/cinder|title=cinder: Instagram's performance-oriented fork of CPython.|website=[[GitHub]]|access-date=4 May 2021|language=en|archive-date=4 May 2021|archive-url=https://web.archive.org/web/20210504112500/https://github.com/facebookincubator/cinder|url-status=live}}</ref>
* [https://sneklang.org/ Snek]<!-- (previously named Newt) --><ref>{{Cite web |last=Aroca |first=Rafael |date=2021-08-07 |title=Snek Lang: feels like Python on Arduinos |url=https://rafaelaroca.wordpress.com/2021/08/07/snek-lang-feels-like-python-on-arduinos/ |access-date=2024-01-04 |website=Yet Another Technology Blog |language=en |archive-date=5 January 2024 |archive-url=https://web.archive.org/web/20240105001031/https://rafaelaroca.wordpress.com/2021/08/07/snek-lang-feels-like-python-on-arduinos/ |url-status=live}}</ref><ref>{{Cite web |last=Aufranc (CNXSoft) |first=Jean-Luc |date=2020-01-16 |title=Snekboard Controls LEGO Power Functions with CircuitPython or Snek Programming Languages (Crowdfunding) - CNX Software |url=https://www.cnx-software.com/2020/01/16/snekboard-controls-lego-power-functions-with-circuitpython-or-snek-programming-languages/ |access-date=2024-01-04 |website=CNX Software - Embedded Systems News |language=en-US |archive-date=5 January 2024 |archive-url=https://web.archive.org/web/20240105001031/https://www.cnx-software.com/2020/01/16/snekboard-controls-lego-power-functions-with-circuitpython-or-snek-programming-languages/ |url-status=live}}</ref><ref>{{Cite web |last=Kennedy (@mkennedy) |first=Michael |title=Ready to find out if you're git famous? |url=https://pythonbytes.fm/episodes/show/187/ready-to-find-out-if-youre-git-famous |access-date=2024-01-04 |website=pythonbytes.fm |language=en-US |archive-date=5 January 2024 |archive-url=https://web.archive.org/web/20240105001031/https://pythonbytes.fm/episodes/show/187/ready-to-find-out-if-youre-git-famous |url-status=live}}</ref><!-- https://keithp.com/blogs/newt-lola/ https://bipes.net.br/snek-web-uploader/ --> Embedded Computing Language (compatible with e.g. 8-bit [[AVR microcontrollers]] such as [[ATmega|ATmega 328P]]-based Arduino, as well as larger ones compatible with [[MicroPython]]) "is Python-inspired, but it is not Python. It is possible to write Snek programs that run under a full Python system, but most Python programs will not run under Snek."<ref>{{Cite web |last=Packard |first=Keith |date=2022-12-20 |title=The Snek Programming Language: A Python-inspired Embedded Computing Language |url=https://sneklang.org/doc/snek.pdf |access-date=4 January 2024 |archive-date=4 January 2024 |archive-url=https://web.archive.org/web/20240104162458/https://sneklang.org/doc/snek.pdf |url-status=live}}</ref> It is an imperative language not including [[Object-oriented programming|OOP]] / classes, unlike Python, and simplifying to one number type with 32-bit [[single-precision]] (similar to [[JavaScript]], except smaller). <!-- "Snek is a tiny embeddable language targeting processors with only a few kB of flash and ram. Think of something that would have been running BASIC years ago and you'll have the idea. These processors are too small to run MicroPython." "Snekboard is a custom embedded computer designed to run Snek or CircuitPython." -->


===Unsupported implementations===
Most Python implementations (including CPython, the primary implementation) can function as a [[command line interpreter]], for which the user enters statements sequentially and receives the results immediately. In short, Python acts as a [[shell (computing)|shell]]. While the semantics of the other modes of execution (bytecode compilation, or compilation to native code) preserve the sequential semantics, they offer a speed boost at the cost of interactivity, so they are usually only used outside of a command-line interaction (eg, when importing a module).
Other just-in-time Python compilers have been developed, but are now unsupported:
* Google began a project named [[Unladen Swallow]] in 2009, with the aim of speeding up the Python interpreter five-fold by using the [[LLVM]], and of improving its [[multithreading (computer architecture)|multithreading]] ability to scale to thousands of cores,<ref name="AutoNT-74"/> while ordinary implementations suffer from the [[global interpreter lock]].
* [[Psyco]] is a discontinued [[Just-in-time compilation|just-in-time]] [[run-time algorithm specialization|specializing]] compiler that integrates with CPython and transforms bytecode to machine code at runtime. The emitted code is specialized for certain [[data type]]s and is faster than the standard Python code. Psyco does not support Python&nbsp;2.7 or later.
* [[PyS60]] was a Python&nbsp;2 interpreter for [[Series 60]] mobile phones released by [[Nokia]] in 2005. It implemented many of the modules from the standard library and some additional modules for integrating with the [[Symbian]] operating system. The Nokia [[N900]] also supports Python with [[GTK]] widget libraries, enabling programs to be written and run on the target device.<ref>{{cite web|title=Python on the Nokia N900|url=http://www.stochasticgeometry.ie/2010/04/29/python-on-the-nokia-n900/|website=Stochastic Geometry|date=29 April 2010|access-date=9 July 2015|archive-date=20 June 2019|archive-url=https://web.archive.org/web/20190620000053/http://www.stochasticgeometry.ie/2010/04/29/python-on-the-nokia-n900/|url-status=live}}</ref>


===Cross-compilers to other languages===
Other shells add capabilities beyond those in the basic interpreter, including [[IDLE (Python)|IDLE]] and [[IPython]]. While generally following the visual style of the Python shell, they implement features like auto-completion, retention of session state, and syntax highlighting.
There are several compilers/[[transpiler]]s to high-level object languages, with either unrestricted Python, a restricted subset of Python, or a language similar to Python as the source language:
* Brython,<ref>{{Cite web|title=Brython|url=https://brython.info/|access-date=2021-01-21|website=brython.info|archive-date=3 August 2018|archive-url=https://web.archive.org/web/20180803065954/http://brython.info/|url-status=live}}</ref> Transcrypt<ref>{{cite web|title=Transcrypt – Python in the browser|url=https://www.transcrypt.org|access-date=22 December 2020|website=transcrypt.org|language=en|archive-date=19 August 2018|archive-url=https://web.archive.org/web/20180819133303/http://www.transcrypt.org/|url-status=live}}</ref><ref>{{Cite web|url=https://www.infoq.com/articles/transcrypt-python-javascript-compiler/|title=Transcrypt: Anatomy of a Python to JavaScript Compiler|website=InfoQ|access-date=20 January 2021|archive-date=5 December 2020|archive-url=https://web.archive.org/web/20201205193339/https://www.infoq.com/articles/transcrypt-python-javascript-compiler/|url-status=live}}</ref> and [[Pyjs]] (latest release in 2012) compile Python to [[JavaScript]].
* [https://github.com/exaloop/codon Codon] compiles a subset of statically typed Python<ref>{{Cite web |title=Codon: Differences with Python |url=https://docs.exaloop.io/codon/general/differences |url-status=live |archive-url=https://web.archive.org/web/20230525002540/https://docs.exaloop.io/codon/general/differences |archive-date=2023-05-25 |access-date=2023-08-28}}</ref> to machine code (via [[LLVM]]) and supports native multithreading.<ref>{{Cite web |last=Lawson |first=Loraine |date=2023-03-14 |title=MIT-Created Compiler Speeds up Python Code |url=https://thenewstack.io/mit-created-compiler-speeds-up-python-code/ |url-status=live |archive-url=https://web.archive.org/web/20230406054200/https://thenewstack.io/mit-created-compiler-speeds-up-python-code/ |archive-date=2023-04-06 |access-date=2023-08-28 |website=The New Stack |language=en-US}}</ref>
* [[Cython]] compiles (a superset of) Python<!-- actually 2.7 by default, but Python 3 by override --> to C. The resulting code is also usable with Python via direct C-level API calls into the Python interpreter.
* PyJL compiles/transpiles a subset of Python to "human-readable, maintainable, and high-performance Julia source code".<ref name=PyJL>{{Cite web|title=Transpiling Python to Julia using PyJL|url=https://web.ist.utl.pt/antonio.menezes.leitao/ADA/documents/publications_docs/2022_TranspilingPythonToJuliaUsingPyJL.pdf|quote=After manually modifying one line of code by specifying the necessary type information, we obtained a speedup of 52.6×, making the translated Julia code 19.5× faster than the original Python code.|access-date=20 September 2023|archive-date=19 November 2023|archive-url=https://web.archive.org/web/20231119071525/https://web.ist.utl.pt/antonio.menezes.leitao/ADA/documents/publications_docs/2022_TranspilingPythonToJuliaUsingPyJL.pdf|url-status=live}}</ref> Despite claiming high performance, no tool can claim to do that for ''arbitrary'' Python code; i.e. it's known not possible to compile to a faster language or machine code. Unless semantics of Python are changed, but in many cases speedup is possible with few or no changes in the Python code. The faster Julia source code can then be used from Python, or compiled to machine code, and based that way.
* [[Nuitka]] compiles Python into C.<ref>{{cite web|title=Nuitka Home {{!}} Nuitka Home|url=http://nuitka.net/|access-date=18 August 2017|website=nuitka.net|language=en|archive-date=30 May 2020|archive-url=https://web.archive.org/web/20200530211233/https://nuitka.net/|url-status=live}}</ref>
* [[Numba]] uses LLVM to compile a subset of Python to machine code.
* Pythran compiles a subset of Python&nbsp;3 to C++ ([[C++11]]).<ref name="Guelton Brunet Amini Merlini 2015 p=014001">{{cite journal |last1=Guelton |first1=Serge |last2=Brunet |first2=Pierrick |last3=Amini |first3=Mehdi |last4=Merlini |first4=Adrien |last5=Corbillon |first5=Xavier |last6=Raynaud |first6=Alan |title=Pythran: enabling static optimization of scientific Python programs |journal=Computational Science & Discovery |publisher=IOP Publishing |volume=8 |issue=1 |date=16 March 2015 |issn=1749-4699 |doi=10.1088/1749-4680/8/1/014001|doi-access=free |page=014001 |bibcode=2015CS&D....8a4001G}}</ref>
* [[RPython]] can be compiled to C, and is used to build the PyPy interpreter of Python.
* The Python → 11l → C++ transpiler<ref>{{Cite web |url=https://11l-lang.org/transpiler |title=The Python → 11l → C++ transpiler |access-date=17 July 2022 |archive-date=24 September 2022 |archive-url=https://web.archive.org/web/20220924233728/https://11l-lang.org/transpiler/ |url-status=live}}</ref> compiles a subset of Python&nbsp;3 to C++ ([[C++17]]).


Specialized:
Some implementations can compile not only to bytecode, but can turn Python code into [[machine code]]. So far, this has only been done for restricted subsets of Python. PyPy takes this approach, naming its restricted compilable version of Python ''[[RPython]]''. [[Shed Skin]] is a similar experimental [[compiler]].
* [[MyHDL]] is a Python-based [[hardware description language]] (HDL), that converts MyHDL code to [[Verilog]] or [[VHDL]] code.


Older projects (or not to be used with Python 3.x and latest syntax):
[[Psyco]] is a [[specialising compiler|specialising]] [[just in time compiler]] which transforms bytecode to machine code at runtime. The produced code is specialised for certain [[data types]] and is faster than standard Python code. Psyco is compatible with all Python code, not only a subset.<ref>[http://psyco.sourceforge.net/introduction.html Introduction to Psyco]</ref>
* Google's Grumpy (latest release in 2017) [[transpile]]s Python&nbsp;2 to [[Go (programming language)|Go]].<ref>{{Cite web|url=https://github.com/google/grumpy|title=google/grumpy|date=10 April 2020|via=GitHub|access-date=25 March 2020|archive-date=15 April 2020|archive-url=https://web.archive.org/web/20200415054919/https://github.com/google/grumpy|url-status=live}}</ref><ref>{{Cite web|url=https://opensource.google/projects/|title=Projects|website=opensource.google|access-date=25 March 2020|archive-date=24 April 2020|archive-url=https://web.archive.org/web/20200424191248/https://opensource.google/projects/|url-status=live}}</ref><ref>{{Cite web|url=https://www.theregister.com/2017/01/05/googles_grumpy_makes_python_go/|title=Google's Grumpy code makes Python Go|first=Thomas Claburn in San|last=Francisco|website=www.theregister.com|access-date=20 January 2021|archive-date=7 March 2021|archive-url=https://web.archive.org/web/20210307165521/https://www.theregister.com/2017/01/05/googles_grumpy_makes_python_go/|url-status=live}}</ref>
* [[IronPython]]<!-- (abandoned by Microsoft) --> allows running Python&nbsp;2.7 programs (and an [[Software release life cycle#Alpha|alpha]], released in 2021, is also available for "Python&nbsp;3.4, although features and behaviors from later versions may be included"<ref>{{Cite web |url=https://github.com/IronLanguages/ironpython3 |title=GitHub – IronLanguages/ironpython3: Implementation of Python 3.x for .NET Framework that is built on top of the Dynamic Language Runtime<!-- Bot generated title --> |website=[[GitHub]] |archive-date=28 September 2021 |archive-url=https://web.archive.org/web/20210928101250/https://github.com/IronLanguages/ironpython3 |url-status=live}}</ref>) on the .NET [[Common Language Runtime]].<ref>{{Cite web|title=IronPython.net /|url=https://ironpython.net/|website=ironpython.net|archive-date=17 April 2021|archive-url=https://web.archive.org/web/20210417064418/https://ironpython.net/|url-status=live}}</ref>
* [[Jython]] compiles Python&nbsp;2.7 to Java bytecode, allowing the use of the Java libraries from a Python program.<ref>{{Cite web|title=Jython FAQ|url=https://www.jython.org/jython-old-sites/archive/22/userfaq.html|access-date=2021-04-22|website=www.jython.org|archive-date=22 April 2021|archive-url=https://web.archive.org/web/20210422055726/https://www.jython.org/jython-old-sites/archive/22/userfaq.html|url-status=live}}</ref>
* [[Pyrex (programming language)|Pyrex]] (latest release in 2010) and [[Shed Skin]] (latest release in 2013) compile to C and C++ respectively.


===Performance===
==Standard library==
Performance comparison of various Python implementations on a non-numerical (combinatorial) workload was presented at EuroSciPy '13.<ref>{{cite conference |title=Performance of Python runtimes on a non-numeric scientific code |last=Murri |first=Riccardo |conference=European Conference on Python in Science (EuroSciPy) |year=2013 |arxiv=1404.6388|bibcode=2014arXiv1404.6388M}}</ref> Python's performance compared to other programming languages is also benchmarked by [[The Computer Language Benchmarks Game]].<ref>{{cite web|title=The Computer Language Benchmarks Game|url=https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python.html|access-date=30 April 2020|archive-date=14 June 2020|archive-url=https://web.archive.org/web/20200614210246/https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python.html|url-status=live}}</ref>
Python has a large standard library, commonly cited as one of Python's greatest strengths,<ref>http://www.oracle.com/technology/pub/articles/piotrowski-pythoncore.html</ref> providing pre-written tools suited to many tasks. This is deliberate and has been described as a "batteries included" Python philosophy. The modules of the standard library can be augmented with custom modules written in either C or Python. Recently, [[Boost C++ Libraries]] includes a library, Boost.Python, to enable interoperability between C++ and Python. Because of the wide variety of tools provided by the standard library, combined with the ability to use a lower-level language such as C and C++, which is already capable of interfacing between other libraries, Python can be a powerful [[glue language]] between languages and tools.


==Development==
The standard library is particularly well tailored to writing Internet-facing applications, with a large number of standard formats and protocols (such as [[MIME]] and [[Hypertext Transfer Protocol|HTTP]]) already supported. Modules for creating [[graphical user interface]]s, connecting to [[relational database]]s, arithmetic with arbitrary precision decimals, and manipulating [[regular expression]]s are also included.<ref>[http://www.python.org/peps/pep-0327.html PEP 327 - Decimal Data Type<!-- Bot generated title -->]</ref> Python also includes a [[unit testing]] framework for creating test suites.
Python's development is conducted largely through the ''Python Enhancement Proposal'' (PEP) process, the primary mechanism for proposing major new features, collecting community input on issues, and documenting Python design decisions.<ref name="PepCite000"/> Python coding style is covered in PEP&nbsp;8.<ref>{{cite web|url=https://www.python.org/dev/peps/pep-0008/|title=PEP 8 – Style Guide for Python Code|website=Python.org|access-date=26 March 2019|archive-date=17 April 2019|archive-url=https://web.archive.org/web/20190417223549/https://www.python.org/dev/peps/pep-0008/|url-status=live}}</ref> Outstanding PEPs are reviewed and commented on by the Python community and the steering council.<ref name="PepCite000"/>


Enhancement of the language corresponds with the development of the CPython reference implementation. The mailing list python-dev is the primary forum for the language's development. Specific issues were originally discussed in the [[Roundup (issue tracker)|Roundup]] [[bug tracker]] hosted at by the foundation.<ref name="AutoNT-21"/> In 2022, all issues and discussions were migrated to [[GitHub]].<ref>{{cite web |url=https://lwn.net/Articles/885854/ |title=Moving Python's bugs to GitHub &#91;LWN.net&#93; |access-date=2 October 2022 |archive-date=2 October 2022 |archive-url=https://web.archive.org/web/20221002183818/https://lwn.net/Articles/885854/ |url-status=live}}</ref> Development originally took place on a [[Self-hosting (web services)|self-hosted]] source-code repository running [[Mercurial]], until Python moved to [[GitHub]] in January 2017.<ref name=py_dev_guide>{{Cite web|url=https://devguide.python.org/|title=Python Developer's Guide – Python Developer's Guide|website=devguide.python.org|access-date=17 December 2019|archive-date=9 November 2020|archive-url=https://web.archive.org/web/20201109032501/https://devguide.python.org/|url-status=live}}</ref>
Some parts of the standard library are covered by specifications (for example, the [[Web Server Gateway Interface|WSGI]] implementation <code>wsgiref</code> follows [http://www.python.org/dev/peps/pep-0333/ PEP 333]), but the majority of the modules are not. They are specified by their code, internal documentation, and test suite (if supplied). However, because most of the standard library is cross-platform Python code, there are only a few modules that must be altered or completely rewritten by alternative implementations.


CPython's public releases come in three types, distinguished by which part of the version number is incremented:
==Programming philosophy==
* Backward-incompatible versions, where code is expected to break and needs to be manually [[ported]]. The first part of the version number is incremented. These releases happen infrequently—version 3.0 was released 8 years after 2.0. According to Guido van Rossum, a version 4.0 is very unlikely to ever happen.<ref>{{Cite web |last=Hughes |first=Owen |date=2021-05-24 |title=Programming languages: Why Python 4.0 might never arrive, according to its creator |url=https://www.techrepublic.com/article/programming-languages-why-python-4-0-will-probably-never-arrive-according-to-its-creator/ |access-date=2022-05-16 |website=TechRepublic |language=en-US |archive-date=14 July 2022 |archive-url=https://web.archive.org/web/20220714201302/https://www.techrepublic.com/article/programming-languages-why-python-4-0-will-probably-never-arrive-according-to-its-creator/ |url-status=live}}</ref>
Python is a [[multi-paradigm programming language]]. This means that, rather than forcing programmers to adopt a particular style of programming, it permits several styles: [[object oriented]] and [[structured programming]] are fully supported, and there are a number of language features which support [[functional programming]] and [[aspect-oriented programming]]. Many other paradigms are supported using extensions, such as [http://www.nongnu.org/pydbc/ pyDBC] and [http://www.wayforward.net/pycontract/ Contracts for Python] which allow [[Design by Contract]]. Python uses [[dynamic typing]] and a combination of [[reference counting]] and a cycle detecting [[Garbage collection (computer science)|garbage collector]] for [[memory management]]. An important feature of Python is dynamic [[name resolution]], which binds method and variable names during program execution (also known as [[late binding]]).
* Major or "feature" releases are largely compatible with the previous version but introduce new features. The second part of the version number is incremented. Starting with Python&nbsp;3.9, these releases are expected to happen annually.<ref>{{Cite web|url=https://www.python.org/dev/peps/pep-0602/|title=PEP 602 – Annual Release Cycle for Python|website=Python.org|language=en|access-date=6 November 2019|archive-date=14 June 2020|archive-url=https://web.archive.org/web/20200614202755/https://www.python.org/dev/peps/pep-0602/|url-status=live}}</ref><ref>{{Cite web|url=https://lwn.net/Articles/802777/|title=Changing the Python release cadence [LWN.net]|website=lwn.net|access-date=6 November 2019|archive-date=6 November 2019|archive-url=https://web.archive.org/web/20191106170153/https://lwn.net/Articles/802777/|url-status=live}}</ref> Each major version is supported by bug fixes for several years after its release.<ref name="release-schedule"/>
* Bugfix releases,<ref name="AutoNT-22"/> which introduce no new features, occur about every 3 months and are made when a sufficient number of bugs have been fixed upstream since the last release. Security vulnerabilities are also patched in these releases. The third and final part of the version number is incremented.<ref name="AutoNT-22"/>


Many [[beta release|alpha, beta, and release-candidates]] are also released as previews and for testing before final releases. Although there is a rough schedule for each release, they are often delayed if the code is not ready. Python's development team monitors the state of the code by running the large [[unit test]] suite during development.<ref name="AutoNT-23"/>
Another target of the language's design is ease of extensibility, rather than having everything built into the language core. New built-in modules are easily written in [[C (programming language)|C]] or [[C++]]. Python can also be used as an extension language for existing modules and applications that need a programmable interface. This design, of a small core language with a large standard library and an easily-extensible interpreter, was intended by van Rossum from the very start, due to his frustrations with [[ABC (programming language)|ABC]], which espoused the opposite mindset.<ref name="venners-interview-pt-1" />


The major [[academic conference]] on Python is [[PyCon]]. There are also special Python mentoring programs, such as [[PyLadies]].
The design of Python offers limited support for [[functional programming]] in the [[Lisp programming language|Lisp]] tradition. However, there are significant parallels between the philosophy of Python and that of minimalist Lisp-family languages such as [[Scheme (programming language)|Scheme]]. The library has two modules (itertools and functools) that implement proven functional tools borrowed from [[Haskell (programming language)|Haskell]] and [[Standard ML]].<ref>[http://docs.python.org/lib/module-itertools.html 6.5 itertools - Functions creating iterators for efficient looping<!-- Bot generated title -->]</ref>


Python 3.12 removed <code>wstr</code> meaning Python extensions<ref>{{Cite web|title=1. Extending Python with C or C++ – Python 3.9.1 documentation|url=https://docs.python.org/3/extending/extending.html|access-date=2021-02-14|website=docs.python.org|archive-date=23 June 2020|archive-url=https://web.archive.org/web/20200623232830/https://docs.python.org/3/extending/extending.html|url-status=live}}</ref> need to be modified,<ref>{{Cite web|title=PEP 623 – Remove wstr from Unicode|url=https://www.python.org/dev/peps/pep-0623/|access-date=2021-02-14|website=Python.org|language=en|archive-date=5 March 2021|archive-url=https://web.archive.org/web/20210305153214/https://www.python.org/dev/peps/pep-0623/|url-status=live}}</ref> and 3.10 added [[pattern matching]] to the language.<ref>{{Cite web|title=PEP 634 – Structural Pattern Matching: Specification|url=https://www.python.org/dev/peps/pep-0634/|access-date=2021-02-14|website=Python.org|language=en|archive-date=6 May 2021|archive-url=https://web.archive.org/web/20210506005315/https://www.python.org/dev/peps/pep-0634/|url-status=live}}</ref>
While offering choice in coding methodology, the Python philosophy rejects exuberant syntax, such as in [[Perl]], in favor of a sparser, less cluttered one. As with Perl, Python's developers expressly promote a particular "culture" or ideology based on what they want the language to be, favoring language forms they see as "beautiful", "explicit" and "simple". As [[Alex Martelli]] put it in his ''Python Cookbook'' (2nd ed., p.230): "To describe something as clever is NOT considered a compliment in the Python culture." Python's philosophy rejects the Perl "[[there is more than one way to do it]]" approach to language design in favor of "there should be one—and preferably only one—obvious way to do it".<ref>[http://www.python.org/dev/peps/pep-0020/ PEP 20 - The Zen of Python<!-- Bot generated title -->]</ref>


Python 3.12 dropped some outdated modules, and more will be dropped in the future, deprecated as of 3.13; already deprecated array 'u' format code will emit <code>DeprecationWarning</code> since 3.13 and will be removed in Python 3.16. The 'w' format code should be used instead. Part of ctypes is also deprecated and <code>http.server.CGIHTTPRequestHandler</code> will emit a DeprecationWarning, and will be removed in 3.15. Using that code already has a high potential for both security and functionality bugs. Parts of the typing module are deprecated, e.g. creating a <code>typing.NamedTuple</code> class using keyword arguments to denote the fields and such (and more) will be disallowed in Python 3.15.
Python eschews [[Optimization (computer science)#When to optimize|premature optimization]], and moreover, rejects patches to non-critical parts of CPython which would offer a marginal increase in speed at the cost of clarity.<ref>[http://www.python.org/dev/culture/ Python Culture]</ref> It is sometimes described as 'slow'.<ref>[http://peter.mapledesign.co.uk/weblog/archives/python-is-slow Python is... slow? — Peter Bowyer’s weblog]</ref> However, most problems are not speed critical, and as computer hardware continues to become exponentially faster, languages do have more hardware resources available. When speed is a problem, Python programmers tend to try to optimize [[bottleneck (engineering)|bottleneck]]s by algorithm improvements or data structure changes, by using a JIT compiler such as Psyco, or by rewriting the time-critical functions in "closer to the metal" languages such as C.<ref>[http://www.python.org/doc/essays/list2str.html Python Patterns - An Optimization Anecdote]</ref>


==API documentation generators==
===Neologisms===
Tools that can generate documentation for Python API include [[pydoc]] (available as part of the standard library), [[Sphinx (documentation generator)|Sphinx]], [[Pdoc]] and its forks, [[Doxygen]] and [[Graphviz]], among others.<ref>{{Cite web |title=Documentation Tools |url=https://wiki.python.org/moin/DocumentationTools |access-date=2021-03-22 |website=Python.org |language=en |archive-date=11 November 2020 |archive-url=https://web.archive.org/web/20201111173635/https://wiki.python.org/moin/DocumentationTools |url-status=live}}</ref>
A common [[neologism]] in the Python community is ''pythonic'', which can have a wide range of meanings related to program style. To say that a piece of code is pythonic is to say that it uses Python idioms well, that it is natural or shows fluency in the language. Likewise, to say of an interface or language feature that it is pythonic is to say that it works well with Python idioms, that its use meshes well with the rest of the language.


==Naming==
In contrast, a mark of ''unpythonic'' code is that it attempts to "write C++ (or Lisp, or Perl) code in Python"—that is, provides a rough transcription rather than an idiomatic translation of forms from another language. The concept of pythonicity is tightly bound to Python's minimalist philosophy of readability and avoiding the "there's more than one way to do it" approach. Unreadable code or incomprehensible idioms are unpythonic.
Python's name is derived from the British comedy group [[Monty Python]], whom Python creator Guido van Rossum enjoyed while developing the language. Monty Python references appear frequently in Python code and culture;<ref name="tutorial-chapter1"/> for example, the [[metasyntactic variable]]s often used in Python literature are [[Spam (Monty Python)|''spam'' and ''eggs'']] instead of the traditional [[foobar|''foo'' and ''bar'']].<ref name="tutorial-chapter1"/><ref name="AutoNT-26"/> The official Python documentation also contains various references to Monty Python routines.<ref>{{cite book |last1=Lutz |first1=Mark |title=Learning Python: Powerful Object-Oriented Programming |year=2009 |publisher=O'Reilly Media, Inc. |isbn=9781449379322 |page=17 |url=https://books.google.com/books?id=1HxWGezDZcgC&pg=PA17 |language=en |access-date=9 May 2017 |archive-date=17 July 2017 |archive-url=https://web.archive.org/web/20170717044012/https://books.google.com/books?id=1HxWGezDZcgC&pg=PA17 |url-status=live}}</ref><ref>{{cite book |last1=Fehily |first1=Chris |title=Python |year=2002 |publisher=Peachpit Press |isbn=9780201748840 |page=xv |url=https://books.google.com/books?id=carqdIdfVlYC&pg=PR15 |language=en |access-date=9 May 2017 |archive-date=17 July 2017 |archive-url=https://web.archive.org/web/20170717044040/https://books.google.com/books?id=carqdIdfVlYC&pg=PR15 |url-status=live}}</ref> Users of Python are sometimes referred to as "Pythonistas".<ref name="introducing_python">{{Cite book |publisher=Sebastopol, CA : O'Reilly Media |isbn=978-1-4493-5936-2 |last=Lubanovic |first=Bill |title=Introducing Python |access-date=2023-07-31 |date=2014 |url=http://archive.org/details/introducingpytho0000luba |page=305}}</ref>


The prefix ''Py-'' is used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include [[Pygame]], a [[language binding|binding]] of [[Simple DirectMedia Layer|SDL]] to Python (commonly used to create games); [[PyQt]] and [[PyGTK]], which bind [[Qt (software)|Qt]] and GTK to Python respectively; and [[PyPy]], a Python implementation originally written in Python.
Users and admirers of Python—most especially those considered knowledgeable or experienced—are often referred to as ''Pythonists'', ''Pythonistas'', and ''Pythoneers''.


==Popularity==
The prefix ''Py'' can be used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include [[Pygame]], a [[Language binding|binding]] of [[Simple DirectMedia Layer|SDL]] to Python (commonly used to create games); [[PyS60]], an implementation for the Symbian Series 60 Operating System; [[PyQt]] and [[PyGTK]], which bind [[Qt (toolkit)|Qt]] and [[GTK]], respectively, to Python; and [[PyPy]], a Python implementation written in Python. The prefix is also used outside of naming software packages: the major Python [[Academic conference|conference]] is named [[PyCon]].
Since 2003, Python has consistently ranked in the top ten most popular programming languages in the [[TIOBE Programming Community Index]] where {{as of|2022|12|lc=y}} it was the most popular language (ahead of C, C++, and [[Java (programming language)|Java]]).<ref name=tiobecurrent/> It was selected as Programming Language of the Year (for "the highest rise in ratings in a year") in 2007, 2010, 2018, and 2020 (the only language to have done so four times {{as of|2020|lc=true}}<ref>{{Cite web|last=Blake|first=Troy|date=2021-01-18|title=TIOBE Index for January 2021|url=https://seniordba.wordpress.com/2021/01/18/tiobe-index-for-january-2021/|access-date=2021-02-26|website=Technology News and Information by SeniorDBA|language=en|archive-date=21 March 2021|archive-url=https://web.archive.org/web/20210321143253/https://seniordba.wordpress.com/2021/01/18/tiobe-index-for-january-2021/|url-status=live}}</ref>).


Large organizations that use Python include [[Wikipedia]], [[Google]],<ref name="quotes-about-python"/> [[Yahoo!]],<ref name="AutoNT-29"/> [[CERN]],<ref name="AutoNT-30"/> [[NASA]],<ref name="AutoNT-31"/> [[Facebook]],<ref>{{Cite web|url=https://developers.facebook.com/blog/post/301|title=Tornado: Facebook's Real-Time Web Framework for Python – Facebook for Developers|website=Facebook for Developers|language=en-US|access-date=19 June 2018|archive-date=19 February 2019|archive-url=https://web.archive.org/web/20190219031313/https://developers.facebook.com/blog/post/301|url-status=live}}</ref> [[Amazon (company)|Amazon]], [[Instagram]],<ref>{{cite web |url=https://instagram-engineering.com/what-powers-instagram-hundreds-of-instances-dozens-of-technologies-adf2e22da2ad |title=What Powers Instagram: Hundreds of Instances, Dozens of Technologies |date=11 December 2016 |publisher=Instagram Engineering |access-date=27 May 2019 |archive-date=15 June 2020 |archive-url=https://web.archive.org/web/20200615183410/https://instagram-engineering.com/what-powers-instagram-hundreds-of-instances-dozens-of-technologies-adf2e22da2ad |url-status=live}}</ref> [[Spotify]],<ref>{{Cite web|url=https://labs.spotify.com/2013/03/20/how-we-use-python-at-spotify/|title=How we use Python at Spotify|website=Spotify Labs|language=en-US|access-date=25 July 2018|date=20 March 2013|archive-date=10 June 2020|archive-url=https://web.archive.org/web/20200610005143/https://labs.spotify.com/2013/03/20/how-we-use-python-at-spotify/|url-status=live}}</ref> and some smaller entities like [[Industrial Light & Magic|ILM]]<ref name="AutoNT-32"/> and [[ITA Software|ITA]].<ref name="AutoNT-33"/> The social news networking site [[Reddit]] was written mostly in Python.<ref>{{Citation|title=GitHub – reddit-archive/reddit: historical code from reddit.com.|url=https://github.com/reddit-archive/reddit|publisher=The Reddit Archives|access-date=20 March 2019|archive-date=1 June 2020|archive-url=https://web.archive.org/web/20200601104939/https://github.com/reddit-archive/reddit|url-status=live}}</ref>
An important goal of the Python developers is making Python fun to use. This is reflected in the origin of the name (based on the television series ''[[Monty Python's Flying Circus]]''), in the common practice of using Monty Python references in example code, and in an occasionally playful approach to tutorials and reference materials.<ref>[http://docs.python.org/tut/node3.html Python Tutorial]</ref> For example, the [[metasyntactic variable]]s often used in Python literature are [[Spam (Monty Python)|''spam'' and ''eggs'']], instead of the traditional [[foobar|''foo'' and ''bar'']].


==Uses==
==Influences on other languages==
{{Main|List of Python software}}
Python's design and philosophy have influenced several programming languages:
[[File:Python Powered.png|thumb|Python Powered]]
Python can serve as a [[scripting language]] for [[web application]]s, e.g. via {{Not a typo|[[mod_wsgi]]}} for the [[Apache webserver]].<ref name="AutoNT-35"/> With [[Web Server Gateway Interface]], a standard API has evolved to facilitate these applications. [[Web framework]]s like [[Django (web framework)|Django]], [[Pylons (web framework)|Pylons]], [[Pyramid (web framework)|Pyramid]], [[TurboGears]], [[web2py]], [[Tornado (web server)|Tornado]], [[Flask (web framework)|Flask]], Bottle, and [[Zope]] support developers in the design and maintenance of complex applications. Pyjs and [[IronPython]] can be used to develop the client-side of Ajax-based applications. [[SQLAlchemy]] can be used as a [[Data mapper pattern|data mapper]] to a relational database. [[Twisted (software)|Twisted]] is a framework to program communications between computers, and is used (for example) by [[Dropbox (service)|Dropbox]].


Libraries such as [[NumPy]], [[SciPy]] and [[Matplotlib]] allow the effective use of Python in scientific computing,<ref name="cise">{{cite journal |last=Oliphant |first=Travis |title=Python for Scientific Computing |journal=Computing in Science and Engineering |volume=9 |issue=3 |pages=10–20 |year=2007 |url=https://www.h2desk.com/blog/python-scientific-computing/ |doi=10.1109/MCSE.2007.58 |citeseerx=10.1.1.474.6460 |bibcode=2007CSE.....9c..10O |s2cid=206457124 |access-date=10 April 2015 |archive-date=15 June 2020 |archive-url=https://web.archive.org/web/20200615193226/https://www.h2desk.com/blog/python-scientific-computing/ |url-status=live}}</ref><ref name="millman">{{cite journal |first1=K. Jarrod |last1=Millman |first2=Michael |last2=Aivazis |title=Python for Scientists and Engineers |journal=Computing in Science and Engineering |volume=13 |number=2 |pages=9–12 |year=2011 |url=http://www.computer.org/csdl/mags/cs/2011/02/mcs2011020009.html |doi=10.1109/MCSE.2011.36 |bibcode=2011CSE....13b...9M |access-date=7 July 2014 |archive-date=19 February 2019 |archive-url=https://web.archive.org/web/20190219031439/https://www.computer.org/csdl/mags/cs/2011/02/mcs2011020009.html |url-status=live}}</ref> with specialized libraries such as [[Biopython]] and [[Astropy]] providing domain-specific functionality. [[SageMath]] is a [[computer algebra system]] with a [[notebook interface]] programmable in Python: its library covers many aspects of [[mathematics]], including [[algebra]], [[combinatorics]], [[numerical mathematics]], [[number theory]], and [[calculus]].<ref name="ICSE" >{{Citation|title=Science education with SageMath|url=http://visual.icse.us.edu.pl/methodology/why_Sage.html|publisher=Innovative Computing in Science Education|access-date=22 April 2019|archive-date=15 June 2020|archive-url=https://web.archive.org/web/20200615180428/http://visual.icse.us.edu.pl/methodology/why_Sage.html|url-status=dead}}</ref> [[OpenCV]] has Python bindings with a rich set of features for [[computer vision]] and [[Digital image processing|image processing]].<ref>{{Cite web|title=OpenCV: OpenCV-Python Tutorials|url=https://docs.opencv.org/3.4.9/d6/d00/tutorial_py_root.html|access-date=2020-09-14|website=docs.opencv.org|archive-date=23 September 2020|archive-url=https://web.archive.org/web/20200923063145/https://docs.opencv.org/3.4.9/d6/d00/tutorial_py_root.html|url-status=live}}</ref>
* [[Boo (programming language)|Boo]] uses indentation, a similar syntax, and a similar object model. However, Boo uses [[static typing]] and is closely integrated with the [[.NET framework]].<ref>[http://boo.codehaus.org/Gotchas+for+Python+Users BOO - Gotchas for Python Users<!-- Bot generated title -->]</ref>
* [[Cobra (programming language from Cobra Language LLC)|Cobra]] is also similar to Python, using indentation for blocks. It offers optional static typing and generates code designed for .NET/Mono. Cobra directly supports [[Design by contract|design-by-contract]] contracts.<ref>[http://cobra-language.com/docs/python/ Comparison to Python], cobra-language.com</ref>
* [[ECMAScript]] borrowed [[Iterator#Python|iterators]], [[Generator (computer science)|generators]] and [[list comprehension]]s from Python.<ref>[http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators proposals:iterators_and_generators [ES4 Wiki&#93;<!-- Bot generated title -->]</ref>
* [[Groovy (programming language)|Groovy]] was motivated by the desire to bring the Python design philosophy to [[Java (programming language)|Java]].<ref>{{cite web
| author = James Strachan
| date = 2003-08-29
| title = Groovy - the birth of a new dynamic language for the Java platform
| url = http://radio.weblogs.com/0112098/2003/08/29.html
}}</ref>
* [[Converge (programming language)|Converge]] is syntactically similar to Python, but has an interesting approach to [[Generator (computer science)|generators]] and [[backtracking]] as well as [[Macro (computer science)|macros]] and compile-time [[Metaprogramming|metaprogramming]].<ref>{{cite web
| author = Laurence Tratt
| title = Converge - About
| url = http://convergepl.org/about.html
}}</ref>


Python is commonly used in [[artificial intelligence]] projects and machine learning projects with the help of libraries like [[TensorFlow]], [[Keras]], [[PyTorch|Pytorch]], [[scikit-learn]] and the Logic language [[ProbLog]].<ref name=whitepaper2015>{{cite web |last1=Dean |first1=Jeff |last2=Monga |first2=Rajat |first3=Sanjay |last3=Ghemawat |display-authors=2 |author-link1=Jeff Dean (computer scientist) |title=TensorFlow: Large-scale machine learning on heterogeneous systems |url=http://download.tensorflow.org/paper/whitepaper2015.pdf |website=TensorFlow.org |publisher=Google Research |access-date=10 November 2015 |date=9 November 2015 |archive-date=20 November 2015 |archive-url=https://web.archive.org/web/20151120004649/http://download.tensorflow.org/paper/whitepaper2015.pdf |url-status=live}}</ref><ref>{{cite web |last1=Piatetsky |first1=Gregory |title=Python eats away at R: Top Software for Analytics, Data Science, Machine Learning in 2018: Trends and Analysis |url=https://www.kdnuggets.com/2018/05/poll-tools-analytics-data-science-machine-learning-results.html/2 |website=KDnuggets |access-date=30 May 2018 |archive-date=15 November 2019 |archive-url=https://web.archive.org/web/20191115234216/https://www.kdnuggets.com/2018/05/poll-tools-analytics-data-science-machine-learning-results.html/2 |url-status=live}}</ref><ref>{{cite web|url=https://scikit-learn.org/stable/testimonials/testimonials.html|title=Who is using scikit-learn? – scikit-learn 0.20.1 documentation|website=scikit-learn.org|access-date=30 November 2018|archive-date=6 May 2020|archive-url=https://web.archive.org/web/20200506210716/https://scikit-learn.org/stable/testimonials/testimonials.html|url-status=live}}</ref><ref>{{cite web |author-link1=Norman Jouppi |last1=Jouppi |first1=Norm |title=Google supercharges machine learning tasks with TPU custom chip |url=https://cloudplatform.googleblog.com/2016/05/Google-supercharges-machine-learning-tasks-with-custom-chip.html |website=Google Cloud Platform Blog |access-date=19 May 2016 |archive-date=18 May 2016 |archive-url=https://web.archive.org/web/20160518201516/https://cloudplatform.googleblog.com/2016/05/Google-supercharges-machine-learning-tasks-with-custom-chip.html |url-status=live}}</ref><ref name="ProbLogConcepts">{{cite journal |last1=De Raedt |first1=Luc |last2=Kimmig|first2=Angelika |title=Probabilistic (logic) programming concepts |journal=Machine Learning |date=2015 |volume=100 |number=1 |pages=5–47 |doi=10.1007/s10994-015-5494-z |s2cid=3166992 |doi-access=free}}</ref> As a scripting language with a [[modular programming|modular architecture]], simple syntax, and rich text processing tools, Python is often used for [[natural language processing]].<ref name="AutoNT-47"/>
Python's development practices have also been emulated by other languages. The practice of requiring a document describing the rationale for, and issues surrounding, a change to the language (ie, a PEP) is also used in [[Tcl]] because of Python's influence.<ref>[http://www.tcl.tk/cgi-bin/tct/tip/3.html TIP #3: TIP Format<!-- Bot generated title -->]</ref>


The combination of Python and [[Prolog]] has proved to be particularly useful for AI applications, with Prolog providing knowledge representation and reasoning capablities. The Janus system, in particular, exploits the similarites between these two languages,
== References ==
in part because of their use of dynamic typing, and the simple recursive nature of their
data structures. Typical applications of this combination include natural language processing, visual query
answering, geospatial reasoning, and handling of semantic web data.<ref>Andersen, C. and Swift, T., 2023. The Janus System: a bridge to new prolog applications. In Prolog: The Next 50 Years (pp. 93-104). Cham: Springer Nature Switzerland.</ref><ref>{{Cite web |title=SWI-Prolog Python interface |url=https://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/janus.html%27) |access-date=2024-03-15 |language=en-US |archive-date=15 March 2024 |archive-url=https://web.archive.org/web/20240315162046/https://www.swi-prolog.org/pldoc/doc_for?object=section%28%27packages%2Fjanus.html%27%29 |url-status=live}}</ref>
The Natlog system, implemented in Python, uses [[Definite clause grammar|Definite Clause Grammars]] (DCGs) as prompt generators for text-to-text generators like GPT3 and text-to-image generators like DALL-E or Stable Diffusion.<ref>Tarau, P., 2023. Reflections on automation, learnability and expressiveness in logic-based programming languages. In Prolog: The Next 50 Years (pp. 359-371). Cham: Springer Nature Switzerland.</ref>


Python can also be used for [[graphical user interface]] (GUI) by using libraries like [[Tkinter]].<ref>{{cite web |url=https://docs.python.org/3/library/tkinter.html |title=Tkinter — Python interface to TCL/Tk |access-date=9 June 2023 |archive-date=18 October 2012 |archive-url=https://web.archive.org/web/20121018043136/http://docs.python.org/library/tkinter.html |url-status=live}}</ref><ref>{{cite web |url=https://www.geeksforgeeks.org/python-tkinter-tutorial/ |title=Python Tkinter Tutorial |date=3 June 2020 |access-date=9 June 2023 |archive-date=9 June 2023 |archive-url=https://web.archive.org/web/20230609031631/https://www.geeksforgeeks.org/python-tkinter-tutorial/ |url-status=live}}</ref>
{{refs|2}}


Python has been successfully embedded in many software products as a scripting language, including in [[finite element method]] software such as [[Abaqus]], 3D parametric modelers like [[FreeCAD]], 3D animation packages such as [[3ds Max]], [[Blender (software)|Blender]], [[Cinema 4D]], [[LightWave 3D|Lightwave]], [[Houdini (software)|Houdini]], [[Maya (software)|Maya]], [[modo (software)|modo]], [[MotionBuilder]], [[Autodesk Softimage|Softimage]], the visual effects compositor [[Nuke (software)|Nuke]], 2D imaging programs like [[GIMP]],<ref>{{cite web |url=http://gimp-win.sourceforge.net/faq.html |title=Installers for GIMP for Windows – Frequently Asked Questions |author=<!-- Staff writer(s); no by-line. --> |date=26 July 2013 |access-date=26 July 2013 |url-status=dead |archive-url=https://web.archive.org/web/20130717070814/http://gimp-win.sourceforge.net/faq.html |archive-date=17 July 2013}}</ref> [[Inkscape]], [[Scribus]] and [[Paint Shop Pro]],<ref name="AutoNT-38"/> and [[musical notation]] programs like [[scorewriter]] and [[Capella (notation program)|capella]]. [[GNU Debugger]] uses Python as a [[Prettyprint|pretty printer]] to show complex structures such as C++ containers. [[Esri]] promotes Python as the best choice for writing scripts in [[ArcGIS]].<ref name="AutoNT-39"/> It has also been used in several video games,<ref name="AutoNT-40"/><ref name="AutoNT-41"/> and has been adopted as first of the three available [[programming language]]s in [[Google App Engine]], the other two being [[Java (software platform)|Java]] and [[Go (programming language)|Go]].<ref name="AutoNT-42"/>
== See also ==

Many operating systems include Python as a standard component. It ships with most [[Linux distribution]]s,<ref>{{Cite web|url=https://docs.python.org/3/using/unix.html|title=Python Setup and Usage|publisher=Python Software Foundation|access-date=10 January 2020|archive-date=17 June 2020|archive-url=https://web.archive.org/web/20200617143505/https://docs.python.org/3/using/unix.html|url-status=live}}</ref> [[AmigaOS 4]] (using Python&nbsp;2.7), [[FreeBSD]] (as a package), [[NetBSD]], and [[OpenBSD]] (as a package) and can be used from the command line (terminal). Many Linux distributions use installers written in Python: [[Ubuntu (operating system)|Ubuntu]] uses the [[Ubiquity (software)|Ubiquity]] installer, while [[Red Hat Linux]] and [[Fedora Linux]] use the [[Anaconda (installer)|Anaconda]] installer. [[Gentoo Linux]] uses Python in its [[package management system]], [[Portage (software)|Portage]].

Python is used extensively in the [[information security]] industry, including in exploit development.<ref name="AutoNT-49"/><ref name="AutoNT-50"/>

Most of the [[Sugar (software)|Sugar]] software for the [[One Laptop per Child]] XO, developed at [[Sugar Labs]] {{as of|2008|lc=true}}, is written in Python.<ref name="AutoNT-51"/> The [[Raspberry Pi]] [[single-board computer]] project has adopted Python as its main user-programming language.

[[LibreOffice]] includes Python and intends to replace Java with Python. Its Python Scripting Provider is a core feature<ref>{{cite web |title=4.0 New Features and Fixes |publisher=[[The Document Foundation]] |work=LibreOffice.org |year=2013 |url=http://www.libreoffice.org/download/4-0-new-features-and-fixes/ |access-date=25 February 2013 |archive-date=9 February 2014 |archive-url=https://web.archive.org/web/20140209184807/http://www.libreoffice.org/download/4-0-new-features-and-fixes/ |url-status=live}}</ref> since Version 4.0 from 7 February 2013.

==Languages influenced by Python==
Python's design and philosophy have influenced many other programming languages:
* [[Boo (programming language)|Boo]] uses indentation, a similar syntax, and a similar object model.<ref name="AutoNT-90"/>
* [[Cobra (programming language)|Cobra]] uses indentation and a similar syntax, and its ''Acknowledgements'' document lists Python first among languages that influenced it.<ref name="AutoNT-91"/>
* [[CoffeeScript]], a programming language that cross-compiles to JavaScript, has Python-inspired syntax.
* [[ECMAScript]]–[[JavaScript]] borrowed iterators and [[generator (computer science)|generators]] from Python.<ref name="AutoNT-93"/>
* [[GDScript]], a scripting language very similar to Python, built-in to the [[Godot (game engine)|Godot]] game engine.<ref>{{Cite web|url=https://docs.godotengine.org/en/stable/about/faq.html|title=Frequently asked questions|website=Godot Engine documentation|access-date=10 May 2021|archive-date=28 April 2021|archive-url=https://web.archive.org/web/20210428053339/https://docs.godotengine.org/en/stable/about/faq.html|url-status=live}}</ref>
* [[Go (programming language)|Go]] is designed for the "speed of working in a dynamic language like Python"<ref name="AutoNT-94"/> and shares the same syntax for slicing arrays.
* [[Groovy (programming language)|Groovy]] was motivated by the desire to bring the Python design philosophy to [[Java (programming language)|Java]].<ref name="AutoNT-95"/>
* [[Julia (programming language)|Julia]] was designed to be "as usable for general programming as Python".<ref name=Julia>{{cite web |title= Why We Created Julia |date= February 2012 |website= Julia website |url= https://julialang.org/blog/2012/02/why-we-created-julia |access-date= 5 June 2014 |quote= We want something as usable for general programming as Python [...] |archive-date= 2 May 2020 |archive-url= https://web.archive.org/web/20200502144010/https://julialang.org/blog/2012/02/why-we-created-julia/ |url-status= live}}</ref>
* [[Mojo (programming language)|Mojo]] is a non-strict<ref name="Mojo"/><ref>{{Cite web |title=Modular Docs - Why Mojo |url=https://docs.modular.com/mojo/why-mojo.html |access-date=2023-05-05 |website=docs.modular.com |language=en |quote=Mojo as a member of the Python family [..] Embracing Python massively simplifies our design efforts, because most of the syntax is already specified. [..] we decided that the right long-term goal for Mojo is to provide a superset of Python (i.e. be compatible with existing programs) and to embrace the CPython immediately for long-tail ecosystem enablement. To a Python programmer, we expect and hope that Mojo will be immediately familiar, while also providing new tools for developing systems-level code that enable you to do things that Python falls back to C and C++ for. |archive-date=5 May 2023 |archive-url=https://web.archive.org/web/20230505083518/https://docs.modular.com/mojo/why-mojo.html |url-status=live}}</ref> superset of Python (e.g. still missing classes, and adding e.g. [[struct]]).<ref>{{Cite web |last=Spencer |first=Michael |title=What is Mojo Programming Language? |url=https://datasciencelearningcenter.substack.com/p/what-is-mojo-programming-language |access-date=2023-05-05 |website=datasciencelearningcenter.substack.com |date=4 May 2023 |language=en |archive-date=5 May 2023 |archive-url=https://web.archive.org/web/20230505090408/https://datasciencelearningcenter.substack.com/p/what-is-mojo-programming-language |url-status=live}}</ref>
* [[Nim (programming language)|Nim]] uses indentation and similar syntax.<ref>{{cite web |url=https://www.infoworld.com/article/3157745/application-development/nim-language-draws-from-best-of-python-rust-go-and-lisp.html |title=Nim language draws from best of Python, Rust, Go, and Lisp |first=Serdar |last=Yegulalp |date=16 January 2017 |website=InfoWorld |quote=Nim's syntax is strongly reminiscent of Python's, as it uses indented code blocks and some of the same syntax (such as the way if/elif/then/else blocks are constructed). |access-date=7 June 2020 |archive-date=13 October 2018 |archive-url=https://web.archive.org/web/20181013211847/https://www.infoworld.com/article/3157745/application-development/nim-language-draws-from-best-of-python-rust-go-and-lisp.html |url-status=live}}</ref>
* [[Ruby (programming language)|Ruby]]'s creator, [[Yukihiro Matsumoto]], has said: "I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python. That's why I decided to design my own language."<ref name="linuxdevcenter"/>
* [[Swift (programming language)|Swift]], a programming language developed by Apple, has some Python-inspired syntax.<ref>{{cite web |url=http://nondot.org/sabre |title=Chris Lattner's Homepage |publisher=Chris Lattner |first=Chris |last=Lattner |author-link=Chris Lattner |date=3 June 2014 |access-date=3 June 2014 |quote=I started work on the Swift Programming Language in July of 2010. I implemented much of the basic language structure, with only a few people knowing of its existence. A few other (amazing) people started contributing in earnest late in 2011, and it became a major focus for the Apple Developer Tools group in July 2013 [...] drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list. |archive-date=22 December 2015 |archive-url=https://web.archive.org/web/20151222150510/http://nondot.org/sabre/ |url-status=live}}</ref>
* [[Kotlin (programming language)|Kotlin]] blends Python and Java features, minimizing boilerplate code for enhanced developer efficiency.<ref>{{Cite web |last=Jalan |first=Nishant Aanjaney |date=2022-11-10 |title=Programming in Kotlin |url=https://medium.com/codex/programming-in-kotlin-934bdb3659cf |access-date=2024-04-29 |website=CodeX |language=en}}</ref>

Python's development practices have also been emulated by other languages. For example, the practice of requiring a document describing the rationale for, and issues surrounding, a change to the language (in Python, a PEP) is also used in [[Tcl]],<ref name="AutoNT-99"/> [[Erlang (programming language)|Erlang]],<ref name="AutoNT-100"/> and Swift.<ref>{{cite web |title=Swift Evolution Process |date=18 February 2020 |website=Swift Programming Language Evolution repository on GitHub |url=https://github.com/apple/swift-evolution/blob/master/process.md |access-date=27 April 2020 |archive-date=27 April 2020 |archive-url=https://web.archive.org/web/20200427182556/https://github.com/apple/swift-evolution/blob/master/process.md |url-status=live}}</ref>

==See also==
{{Portal|Computer programming|Free and open-source software}}
* [[Python syntax and semantics]]
* [[pip (package manager)]]
* [[List of programming languages]]
* [[List of programming languages]]
* [[Comparison of computer shells]]
* [[History of programming languages]]
* [[Comparison of programming languages]]
* [[Comparison of programming languages]]
{{Clear}}
* [[List of applications written in Python]]

* [[List of integrated development environments for Python]]
==References==
* [[Guido van Robot]]
{{Reflist|30em|refs=
* [[Scripting language]]

<ref name="faq-created">{{cite web |url=https://docs.python.org/faq/general.html#why-was-python-created-in-the-first-place |title=Why was Python created in the first place? |work=General Python FAQ |publisher=Python Software Foundation |access-date=22 March 2007 |archive-date=24 October 2012 |archive-url=https://web.archive.org/web/20121024164224/http://docs.python.org/faq/general.html#why-was-python-created-in-the-first-place |url-status=live |quote=I had extensive experience with implementing an interpreted language in the ABC group at CWI, and from working with this group I had learned a lot about language design. This is the origin of many Python features, including the use of indentation for statement grouping and the inclusion of very high-level data types (although the details are all different in Python).}}</ref>

<ref name="98-interview">{{cite web |url=http://www.amk.ca/python/writing/gvr-interview |title=Interview with Guido van Rossum (July 1998) |last=Kuchling |first=Andrew M. |work=amk.ca |date=22 December 2006 |access-date=12 March 2012 |url-status=dead |archive-url=https://web.archive.org/web/20070501105422/http://www.amk.ca/python/writing/gvr-interview |archive-date=1 May 2007 |quote=I'd spent a summer at DEC's Systems Research Center, which introduced me to Modula-2+; the Modula-3 final report was being written there at about the same time. What I learned there later showed up in Python's exception handling, modules, and the fact that methods explicitly contain 'self' in their parameter list. String slicing came from Algol-68 and Icon.}}</ref>

<ref name="AutoNT-1">{{cite journal |last=van Rossum |first=Guido |year=1993 |title=An Introduction to Python for UNIX/C Programmers |journal=Proceedings of the NLUUG Najaarsconferentie (Dutch UNIX Users Group) |quote=even though the design of C is far from ideal, its influence on Python is considerable. |citeseerx=10.1.1.38.2023}}</ref>

<ref name="classmix">{{cite web |url=https://docs.python.org/tutorial/classes.html |title=Classes |work=The Python Tutorial |publisher=Python Software Foundation |access-date=20 February 2012 |quote=It is a mixture of the class mechanisms found in C++ and Modula-3 |archive-date=23 October 2012 |archive-url=https://web.archive.org/web/20121023030209/http://docs.python.org/tutorial/classes.html |url-status=live}}</ref>

<ref name="effbot-call-by-object">{{cite web |url=http://effbot.org/zone/call-by-object.htm |title=Call By Object |work=effbot.org |last=Lundh |first=Fredrik |quote=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. |access-date=21 November 2017 |archive-date=23 November 2019 |archive-url=https://web.archive.org/web/20191123043655/http://effbot.org/zone/call-by-object.htm |url-status=live}}</ref>

<ref name="AutoNT-2">{{cite web |url=https://www.python.org/download/releases/2.3/mro/ |title=The Python 2.3 Method Resolution Order |last=Simionato |first=Michele |publisher=Python Software Foundation |quote=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 |access-date=29 July 2014 |archive-date=20 August 2020 |archive-url=https://web.archive.org/web/20200820231854/https://www.python.org/download/releases/2.3/mro/ |url-status=live}}</ref>

<ref name="AutoNT-3">{{cite web |url=https://docs.python.org/howto/functional.html |title=Functional Programming HOWTO |last=Kuchling |first=A. M. |work=Python v2.7.2 documentation |publisher=Python Software Foundation |quote=List comprehensions and generator expressions [...] are a concise notation for such operations, borrowed from the functional programming language Haskell. |access-date=9 February 2012 |archive-date=24 October 2012 |archive-url=https://web.archive.org/web/20121024163217/http://docs.python.org/howto/functional.html |url-status=live}}</ref>

<ref name="pep0238">{{cite web |url=https://www.python.org/dev/peps/pep-0238/ |title=PEP 238&nbsp;– Changing the Division Operator |first1=Moshe |last1=Zadka |first2=Guido |last2=van Rossum |date=11 March 2001 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=23 October 2013 |archive-date=28 May 2020 |archive-url=https://web.archive.org/web/20200528115550/https://www.python.org/dev/peps/pep-0238/ |url-status=live}}</ref>

<ref name="AutoNT-4">{{cite web |url=https://www.python.org/dev/peps/pep-0255/ |title=PEP 255&nbsp;– Simple Generators |first1=Neil |last1=Schemenauer |first2=Tim |last2=Peters |first3=Magnus Lie |last3=Hetland |date=18 May 2001 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=9 February 2012 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605012926/https://www.python.org/dev/peps/pep-0255/ |url-status=live}}</ref>

<ref name="AutoNT-6">{{cite web |url=https://docs.python.org/3.2/tutorial/controlflow.html |title=More Control Flow Tools |work=Python 3 documentation |publisher=Python Software Foundation |access-date=24 July 2015 |archive-date=4 June 2016 |quote=By popular demand, a few features commonly found in functional programming languages like Lisp have been added to Python. With the lambda keyword, small anonymous functions can be created. |archive-url=https://web.archive.org/web/20160604080843/https://docs.python.org/3.2/tutorial/controlflow.html |url-status=live}}</ref>

<ref name="bini">{{cite book |last=Bini |first=Ola |title=Practical JRuby on Rails Web 2.0 Projects: bringing Ruby on Rails to the Java platform |year=2007 |publisher=APress |location=Berkeley |isbn=978-1-59059-881-8 |page=[https://archive.org/details/practicaljrubyon0000bini/page/3 3] |url-access=registration |url=https://archive.org/details/practicaljrubyon0000bini/page/3}}</ref>

<ref name="AutoNT-7">{{cite web |last=Kuhlman |first=Dave |url=https://www.davekuhlman.org/python_book_01.pdf|title=A Python Book: Beginning Python, Advanced Python, and Python Exercises |at=Section 1.1|url-status=dead |archive-url=https://web.archive.org/web/20120623165941/http://cutter.rexx.com/~dkuhlman/python_book_01.html |archive-date=23 June 2012}}</ref>

<ref name="About">{{cite web |url=https://www.python.org/about |title=About Python |publisher=Python Software Foundation |access-date=24 April 2012 |archive-date=20 April 2012 |archive-url=https://web.archive.org/web/20120420010049/http://www.python.org/about/ |url-status=live}}, second section "Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files."</ref>

<ref name="venners-interview-pt-1">{{cite web |url=http://www.artima.com/intv/pythonP.html |title=The Making of Python |last=Venners |first=Bill |date=13 January 2003 |work=Artima Developer |publisher=Artima |access-date=22 March 2007 |archive-date=1 September 2016 |archive-url=https://web.archive.org/web/20160901183332/http://www.artima.com/intv/pythonP.html |url-status=live}}</ref>

<ref name="timeline-of-python">{{cite web |url=https://python-history.blogspot.com/2009/01/brief-timeline-of-python.html |title=A Brief Timeline of Python |last=van Rossum |first=Guido |date=20 January 2009 |work=The History of Python |access-date=20 January 2009 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605032200/https://python-history.blogspot.com/2009/01/brief-timeline-of-python.html |url-status=live}}</ref>

<ref name="AutoNT-12">{{cite mailing list |url=https://mail.python.org/pipermail/python-dev/2000-August/008881.html |title=SETL (was: Lukewarm about range literals) |date=29 August 2000 |access-date=13 March 2011 |mailing-list=Python-Dev |last=van Rossum |first=Guido |author-link=Guido van Rossum |archive-date=14 July 2018 |archive-url=https://web.archive.org/web/20180714064019/https://mail.python.org/pipermail/python-dev/2000-August/008881.html |url-status=live}}</ref>

<ref name="newin-2.0">{{cite web |url=https://docs.python.org/whatsnew/2.0.html |title=What's New in Python 2.0 |last1=Kuchling |first1=A. M. |last2=Zadka |first2=Moshe |date=16 October 2000 |publisher=Python Software Foundation |access-date=11 February 2012 |archive-date=23 October 2012 |archive-url=https://web.archive.org/web/20121023112045/http://docs.python.org/whatsnew/2.0.html |url-status=live}}</ref>

<!-- <ref name="3.0-release">{{cite web |url=https://www.python.org/download/releases/3.0/ |title=Python 3.0 Release |publisher=Python Software Foundation |access-date=8 July 2009 |archive-date=14 June 2020 |archive-url=https://web.archive.org/web/20200614153714/https://www.python.org/download/releases/3.0/ |url-status=live}}</ref> -->

<ref name="pep-3000">{{cite web |url=https://www.python.org/dev/peps/pep-3000/ |title=PEP 3000&nbsp;– Python 3000 |last=van Rossum |first=Guido |date=5 April 2006 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=27 June 2009 |archive-url=https://web.archive.org/web/20160303231513/https://www.python.org/dev/peps/pep-3000/ |archive-date=3 March 2016 |url-status=dead}}</ref>

<ref name="AutoNT-13">{{cite web |url=https://www.python.org/community/pycon/dc2004/papers/24/metaclasses-pycon.pdf |archive-url=https://web.archive.org/web/20090530030205/http://www.python.org/community/pycon/dc2004/papers/24/metaclasses-pycon.pdf |archive-date=30 May 2009 |title=Python Metaclasses: Who? Why? When? |last=The Cain Gang Ltd. |access-date=27 June 2009 |url-status=dead}}</ref>

<ref name="AutoNT-14">{{cite web |url=https://docs.python.org/3.0/reference/datamodel.html#special-method-names |title=3.3. Special method names |work=The Python Language Reference |publisher=Python Software Foundation |access-date=27 June 2009 |archive-date=15 December 2018 |archive-url=https://web.archive.org/web/20181215123146/https://docs.python.org/3.0/reference/datamodel.html#special-method-names |url-status=live}}</ref>

<ref name="AutoNT-15">{{cite web |url=http://www.nongnu.org/pydbc/ |title=PyDBC: method preconditions, method postconditions and class invariants for Python |access-date=24 September 2011 |archive-date=23 November 2019 |archive-url=https://web.archive.org/web/20191123231931/http://www.nongnu.org/pydbc/ |url-status=live}}</ref>

<ref name="AutoNT-16">{{cite web |url=http://www.wayforward.net/pycontract/ |title=Contracts for Python |access-date=24 September 2011 |archive-date=15 June 2020 |archive-url=https://web.archive.org/web/20200615173404/http://www.wayforward.net/pycontract/ |url-status=live}}</ref>

<ref name="AutoNT-17">{{cite web |url=https://sites.google.com/site/pydatalog/ |title=PyDatalog |access-date=22 July 2012 |archive-date=13 June 2020 |archive-url=https://web.archive.org/web/20200613160231/https://sites.google.com/site/pydatalog/ |url-status=live}}</ref>

<ref name="AutoNT-18">{{cite web |url=https://docs.python.org/3/library/itertools.html |title=6.5 itertools&nbsp;– Functions creating iterators for efficient looping |publisher=Docs.python.org |access-date=22 November 2016 |archive-date=14 June 2020 |archive-url=https://web.archive.org/web/20200614153629/https://docs.python.org/3/library/itertools.html |url-status=live}}</ref>

<ref name="PEP20">{{cite web |url=https://www.python.org/dev/peps/pep-0020/ |title=PEP 20&nbsp;– The Zen of Python |last=Peters |first=Tim |date=19 August 2004 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=24 November 2008 |archive-date=26 December 2018 |archive-url=https://web.archive.org/web/20181226141127/https://www.python.org/dev/peps/pep-0020/ |url-status=live}}</ref>

<ref name="AutoNT-19">{{cite book |url=http://shop.oreilly.com/product/9780596007973.do |title=Python Cookbook, 2nd Edition |publisher=[[O'Reilly Media]] |last1=Martelli |first1=Alex |last2=Ravenscroft |first2=Anna |last3=Ascher |first3=David |year=2005 |page=230 |isbn=978-0-596-00797-3 |access-date=14 November 2015 |archive-date=23 February 2020 |archive-url=https://web.archive.org/web/20200223171254/http://shop.oreilly.com/product/9780596007973.do |url-status=live}}</ref>

<ref name="AutoNT-20">{{cite web |title=Python Culture |website=ebeab |date=January 21, 2014 |url=http://ebeab.com/2014/01/21/python-culture/ |archive-url=https://web.archive.org/web/20140130021902/http://ebeab.com/2014/01/21/python-culture/ |archive-date=January 30, 2014 |url-status=dead}}</ref>

<ref name="PepCite000">{{cite web |url=https://www.python.org/dev/peps/pep-0001/ |title=PEP 1&nbsp;– PEP Purpose and Guidelines |last1=Warsaw |first1=Barry |last2=Hylton |first2=Jeremy |last3=Goodger |first3=David |date=13 June 2000 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=19 April 2011 |archive-date=6 June 2020 |archive-url=https://web.archive.org/web/20200606042011/https://www.python.org/dev/peps/pep-0001/ |url-status=live}}</ref>

<ref name="AutoNT-21">{{cite web |url=https://www.python.org/dev/intro/ |title=Guido, Some Guys, and a Mailing List: How Python is Developed |last=Cannon |first=Brett |work=python.org |publisher=Python Software Foundation |access-date=27 June 2009 |url-status=dead |archive-url=https://web.archive.org/web/20090601134342/http://www.python.org/dev/intro/ |archive-date=1 June 2009}}</ref>

<ref name="release-schedule">{{cite web |url=https://mail.python.org/pipermail/python-dev/2002-April/022739.html |title=&#91;Python-Dev&#93; Release Schedules (was Stability & change) |last=Norwitz |first=Neal |date=8 April 2002 |access-date=27 June 2009 |archive-date=15 December 2018 |archive-url=https://web.archive.org/web/20181215122750/https://mail.python.org/pipermail/python-dev/2002-April/022739.html |url-status=live}}</ref>

<ref name="AutoNT-22">{{cite web |url=https://www.python.org/dev/peps/pep-0006/ |title=PEP 6&nbsp;– Bug Fix Releases |last1=Aahz |last2=Baxter |first2=Anthony |date=15 March 2001 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=27 June 2009 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605001318/https://www.python.org/dev/peps/pep-0006/ |url-status=live}}</ref>

<ref name="AutoNT-23">{{cite web |url=https://www.python.org/dev/buildbot/ |title=Python Buildbot |work=Python Developer's Guide |publisher=Python Software Foundation |access-date=24 September 2011 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605001322/https://www.python.org/dev/buildbot/ |url-status=live}}</ref>

<ref name="whyname">{{cite web |url=https://docs.python.org/3/faq/general.html#why-is-it-called-python |title=Why is it called Python?|work=General Python FAQ |publisher=Docs.python.org |access-date=3 January 2023|archive-date=24 October 2012 |archive-url=https://web.archive.org/web/20121024164224/http://docs.python.org/faq/general.html#why-is-it-called-python |url-status=live}}</ref>

<ref name="tutorial-chapter1">{{cite web |url=https://docs.python.org/tutorial/appetite.html |title=Whetting Your Appetite |work=The Python Tutorial |publisher=Python Software Foundation |access-date=20 February 2012 |archive-date=26 October 2012 |archive-url=https://web.archive.org/web/20121026063559/http://docs.python.org/tutorial/appetite.html |url-status=live}}</ref>

<ref name="AutoNT-26">{{cite web |url=https://stackoverflow.com/questions/5033906/in-python-should-i-use-else-after-a-return-in-an-if-block |title=In Python, should I use else after a return in an if block? |date=17 February 2011 |work=[[Stack Overflow]] |publisher=Stack Exchange |access-date=6 May 2011 |archive-date=20 June 2019 |archive-url=https://web.archive.org/web/20190620000050/https://stackoverflow.com/questions/5033906/in-python-should-i-use-else-after-a-return-in-an-if-block |url-status=live}}</ref>

<ref name="quotes-about-python">{{cite web |url=https://www.python.org/about/quotes/ |title=Quotes about Python |publisher=Python Software Foundation |access-date=8 January 2012 |archive-date=3 June 2020 |archive-url=https://web.archive.org/web/20200603135201/https://www.python.org/about/quotes/ |url-status=live}}</ref>

<ref name="AutoNT-29">{{cite web |url=https://wiki.python.org/moin/OrganizationsUsingPython |title=Organizations Using Python |publisher=Python Software Foundation |access-date=15 January 2009 |archive-date=21 August 2018 |archive-url=https://web.archive.org/web/20180821075931/https://wiki.python.org/moin/OrganizationsUsingPython |url-status=live}}</ref>

<ref name="AutoNT-30">{{cite journal |title=Python : the holy grail of programming |journal=CERN Bulletin |issue=31/2006 |publisher=CERN Publications |date=31 July 2006 |url=http://cdsweb.cern.ch/journal/CERNBulletin/2006/31/News%20Articles/974627?ln=en |access-date=11 February 2012 |archive-date=15 January 2013 |archive-url=https://archive.today/20130115191843/http://cdsweb.cern.ch/journal/CERNBulletin/2006/31/News%20Articles/974627?ln=en |url-status=live}}</ref>

<ref name="AutoNT-31">{{cite web |url=https://www.python.org/about/success/usa/ |title=Python Streamlines Space Shuttle Mission Design |last=Shafer |first=Daniel G. |date=17 January 2003 |publisher=Python Software Foundation |access-date=24 November 2008 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605093424/https://www.python.org/about/success/usa/ |url-status=live}}</ref>

<ref name="AutoNT-32">{{cite web |url=https://www.python.org/about/success/ilm/ |title=Industrial Light & Magic Runs on Python |last=Fortenberry |first=Tim |date=17 January 2003 |publisher=Python Software Foundation |access-date=11 February 2012 |archive-date=6 June 2020 |archive-url=https://web.archive.org/web/20200606042020/https://www.python.org/about/success/ilm/ |url-status=live}}</ref>

<ref name="AutoNT-33">{{cite web |url=http://www.eweek.com/c/a/Application-Development/Python-Slithers-into-Systems/ |title=Python Slithers into Systems |last=Taft |first=Darryl K. |date=5 March 2007 |work=eWeek.com |publisher=Ziff Davis Holdings |access-date=24 September 2011 |archive-date=13 August 2021 |archive-url=https://web.archive.org/web/20210813194304/https://www.eweek.com/development/python-slithers-into-systems/ |url-status=live}}</ref>

<ref name="AutoNT-35">{{cite web |title=Usage statistics and market share of Python for websites |year=2012 |url=http://w3techs.com/technologies/details/pl-python/all/all |access-date=18 December 2012 |archive-date=13 August 2021 |archive-url=https://web.archive.org/web/20210813194305/https://w3techs.com/technologies/details/pl-python |url-status=live}}</ref>

<ref name="AutoNT-38">{{cite web |url=http://www.jasc.com/support/customercare/articles/psp9components.asp |title=jasc psp9components |url-status=dead |archive-url=https://web.archive.org/web/20080319061519/http://www.jasc.com/support/customercare/articles/psp9components.asp |archive-date=19 March 2008}}</ref>

<ref name="AutoNT-39">{{cite web |url=http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=About_getting_started_with_writing_geoprocessing_scripts |title=About getting started with writing geoprocessing scripts |date=17 November 2006 |work=ArcGIS Desktop Help 9.2 |publisher=Environmental Systems Research Institute |access-date=11 February 2012 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605144616/http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=About_getting_started_with_writing_geoprocessing_scripts |url-status=live}}</ref>

<ref name="AutoNT-40">{{cite web |url=http://community.eveonline.com/news/dev-blogs/stackless-python-2.7/ |title=Stackless Python 2.7 |publisher=[[CCP Games]] |date=24 August 2010 |author=CCP porkbelly |work=EVE Community Dev Blogs |quote=As you may know, EVE has at its core the programming language known as Stackless Python. |access-date=11 January 2014 |archive-date=11 January 2014 |archive-url=https://web.archive.org/web/20140111155537/http://community.eveonline.com/news/dev-blogs/stackless-python-2.7/ |url-status=live}}</ref>

<ref name="AutoNT-41">{{cite web |url=http://www.2kgames.com/civ4/blog_03.htm |title=Modding Sid Meier's Civilization IV |last=Caudill |first=Barry |date=20 September 2005 |publisher=[[Firaxis Games]] |archive-url=https://web.archive.org/web/20101202164144/http://www.2kgames.com/civ4/blog_03.htm |archive-date=2 December 2010 |work=Sid Meier's Civilization IV Developer Blog |quote=we created three levels of tools ... The next level offers Python and XML support, letting modders with more experience manipulate the game world and everything in it. |url-status=dead}}</ref>

<ref name="AutoNT-42">{{cite web |url=https://code.google.com/apis/documents/docs/1.0/developers_guide_python.html |title=Python Language Guide (v1.0) |work=Google Documents List Data API v1.0 |archive-url=https://web.archive.org/web/20100715145616/http://code.google.com/apis/documents/docs/1.0/developers_guide_python.html |archive-date=15 July 2010 |url-status=dead}}</ref>

<ref name="AutoNT-47">{{Cite web|url=http://www.nltk.org/|title=Natural Language Toolkit – NLTK 3.5b1 documentation|website=www.nltk.org|access-date=10 April 2020|archive-date=13 June 2020|archive-url=https://web.archive.org/web/20200613003911/http://www.nltk.org/|url-status=live}}</ref>

<ref name="AutoNT-49">{{cite web |url=http://www.immunitysec.com/products-immdbg.shtml |title=Immunity: Knowing You're Secure |url-status=dead |archive-url=https://web.archive.org/web/20090216134332/http://immunitysec.com/products-immdbg.shtml |archive-date=16 February 2009}}</ref>

<ref name="AutoNT-50">{{Cite web|url=https://www.coresecurity.com/|title=Core Security|website=Core Security|access-date=10 April 2020|archive-date=9 June 2020|archive-url=https://web.archive.org/web/20200609165041/http://www.coresecurity.com/|url-status=live}}</ref>

<ref name="AutoNT-51">{{cite web |url=http://sugarlabs.org/go/Sugar |title=What is Sugar? |publisher=Sugar Labs |access-date=11 February 2012 |archive-date=9 January 2009 |archive-url=https://web.archive.org/web/20090109025944/http://sugarlabs.org/go/Sugar |url-status=live}}</ref>

<ref name="AutoNT-52">{{cite web |title=Is Python a good language for beginning programmers? |url=https://docs.python.org/faq/general.html#is-python-a-good-language-for-beginning-programmers |work=General Python FAQ |publisher=Python Software Foundation |access-date=21 March 2007 |archive-date=24 October 2012 |archive-url=https://web.archive.org/web/20121024164224/http://docs.python.org/faq/general.html#is-python-a-good-language-for-beginning-programmers |url-status=live}}</ref>

<ref name="AutoNT-53">{{cite web |url=http://www.secnetix.de/~olli/Python/block_indentation.hawk |title=Myths about indentation in Python |publisher=Secnetix.de |access-date=19 April 2011 |archive-date=18 February 2018 |archive-url=https://web.archive.org/web/20180218162410/http://www.secnetix.de/~olli/Python/block_indentation.hawk |url-status=dead}}</ref>

<!--ref name="AutoNT-54">{{cite web |url=http://c2.com/cgi/wiki?PythonWhiteSpaceDiscussion |title=White Space Discussion |access-date=1 January 2013}}</ref-->

<ref name="AutoNT-55">{{cite web |last=van Rossum |first=Guido |url=http://neopythonic.blogspot.be/2009/04/tail-recursion-elimination.html |title=Tail Recursion Elimination |publisher=Neopythonic.blogspot.be |date=22 April 2009 |access-date=3 December 2012 |archive-date=19 May 2018 |archive-url=https://web.archive.org/web/20180519225253/http://neopythonic.blogspot.be/2009/04/tail-recursion-elimination.html |url-status=live}}</ref>

<ref name="AutoNT-56">{{cite web |title=Language Design Is Not Just Solving Puzzles |url=http://www.artima.com/weblogs/viewpost.jsp?thread=147358 |first=Guido |last=van Rossum |date=9 February 2006 |access-date=21 March 2007 |work=Artima forums |publisher=Artima |archive-date=17 January 2020 |archive-url=https://web.archive.org/web/20200117182525/https://www.artima.com/weblogs/viewpost.jsp?thread=147358 |url-status=live}}</ref>

<ref name="AutoNT-57">{{cite web |url=https://www.python.org/dev/peps/pep-0342/ |title=PEP 342&nbsp;– Coroutines via Enhanced Generators |last1=van Rossum |first1=Guido |last2=Eby |first2=Phillip J. |date=10 May 2005 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=19 February 2012 |archive-date=29 May 2020 |archive-url=https://web.archive.org/web/20200529003739/https://www.python.org/dev/peps/pep-0342/ |url-status=live}}</ref>

<ref name="AutoNT-58">{{cite web |url=https://www.python.org/dev/peps/pep-0380/ |title=PEP 380 |publisher=Python.org |access-date=3 December 2012 |archive-date=4 June 2020 |archive-url=https://web.archive.org/web/20200604233821/https://www.python.org/dev/peps/pep-0380/ |url-status=live}}</ref>

<ref name="AutoNT-59">{{cite web |url=https://www.python.org/dev/peps/pep-0289/ |title=PEP 289&nbsp;– Generator Expressions |last=Hettinger |first=Raymond |date=30 January 2002 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=19 February 2012 |archive-date=14 June 2020 |archive-url=https://web.archive.org/web/20200614153717/https://www.python.org/dev/peps/pep-0289/ |url-status=live}}</ref>

<ref name="AutoNT-60">{{cite web |url=https://www.python.org/dev/peps/pep-0308/ |title=PEP 308&nbsp;– Conditional Expressions |last1=van Rossum |first1=Guido |last2=Hettinger |first2=Raymond |date=7 February 2003 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=13 July 2011 |archive-date=13 March 2016 |archive-url=https://web.archive.org/web/20160313113147/https://www.python.org/dev/peps/pep-0308/ |url-status=live}}</ref>

<ref name="AutoNT-61">{{cite web |url=https://docs.python.org/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls |title=Why must 'self' be used explicitly in method definitions and calls? |work=Design and History FAQ |publisher=Python Software Foundation |access-date=19 February 2012 |archive-date=24 October 2012 |archive-url=https://web.archive.org/web/20121024164243/http://docs.python.org/faq/design.html#why-must-self-be-used-explicitly-in-method-definitions-and-calls |url-status=live}}</ref>

<ref name="classy">{{cite web |title=The Python Language Reference, section 3.3. New-style and classic classes, for release 2.7.1 |access-date=12 January 2011 |url=https://docs.python.org/reference/datamodel.html#new-style-and-classic-classes |archive-date=26 October 2012 |archive-url=https://web.archive.org/web/20121026063834/http://docs.python.org/reference/datamodel.html#new-style-and-classic-classes |url-status=dead}}</ref>

<ref name="pep0237">{{cite web |url=https://www.python.org/dev/peps/pep-0237/ |title=PEP 237&nbsp;– Unifying Long Integers and Integers |last1=Zadka |first1=Moshe |last2=van Rossum |first2=Guido |date=11 March 2001 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=24 September 2011 |archive-date=28 May 2020 |archive-url=https://web.archive.org/web/20200528063237/https://www.python.org/dev/peps/pep-0237/ |url-status=live}}</ref>

<ref name="AutoNT-62">{{cite web |url=https://python-history.blogspot.com/2010/08/why-pythons-integer-division-floors.html |title=Why Python's Integer Division Floors |date=24 August 2010 |access-date=25 August 2010 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605151500/https://python-history.blogspot.com/2010/08/why-pythons-integer-division-floors.html |url-status=live}}</ref>

<ref name="AutoNT-63">{{citation |url=https://docs.python.org/library/functions.html#round |access-date=14 August 2011 |title=round |work=The Python standard library, release 2.7, §2: Built-in functions |archive-date=27 October 2012 |archive-url=https://web.archive.org/web/20121027081602/http://docs.python.org/library/functions.html#round |url-status=live}}</ref>

<ref name="AutoNT-64">{{citation |url=https://docs.python.org/py3k/library/functions.html#round |access-date=14 August 2011 |title=round |work=The Python standard library, release 3.2, §2: Built-in functions |archive-date=25 October 2012 |archive-url=https://web.archive.org/web/20121025141808/http://docs.python.org/py3k/library/functions.html#round |url-status=live}}</ref>

<ref name="AutoNT-65">{{cite book |title=Python Essential Reference |url=https://archive.org/details/pythonessentialr00beaz_036 |url-access=limited |first1=David M. |last1=Beazley |edition=4th |year=2009 |page=[https://archive.org/details/pythonessentialr00beaz_036/page/n90 66] |publisher=Addison-Wesley Professional |isbn=9780672329784}}</ref>

<ref name="CPL">{{cite book |title=The C Programming Language |first1=Brian W. |last1=Kernighan |first2=Dennis M. |last2=Ritchie |title-link=The C Programming Language |edition=2nd |year=1988 |page=[https://archive.org/details/cprogramminglang00bria/page/206 206]}}</ref>

<ref name="AutoNT-66">{{cite web |url=https://www.python.org/dev/peps/pep-0007/ |title=PEP 7&nbsp;– Style Guide for C Code |last=van Rossum |first=Guido |date=5 June 2001 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=24 November 2008 |archive-date=1 June 2020 |archive-url=https://web.archive.org/web/20200601203908/https://www.python.org/dev/peps/pep-0007/ |url-status=live}}</ref>

<ref name="AutoNT-67">{{cite web |url=https://docs.python.org/3/library/dis.html#python-bytecode-instructions |title=CPython byte code |publisher=Docs.python.org |access-date=16 February 2016 |archive-date=5 June 2020 |archive-url=https://web.archive.org/web/20200605151542/https://docs.python.org/3/library/dis.html#python-bytecode-instructions |url-status=live}}</ref>

<ref name="AutoNT-68">{{cite web |url=http://www.troeger.eu/teaching/pythonvm08.pdf |title=Python 2.5 internals |access-date=19 April 2011 |archive-date=6 August 2012 |archive-url=https://web.archive.org/web/20120806094951/http://www.troeger.eu/teaching/pythonvm08.pdf |url-status=live}}</ref>

<ref name="AutoNT-69">{{cite web |url=http://www.oreilly.com/pub/a/oreilly/frank/rossum_1099.html |title=An Interview with Guido van Rossum |publisher=Oreilly.com |access-date=24 November 2008 |archive-date=16 July 2014 |archive-url=https://web.archive.org/web/20140716222652/http://oreilly.com/pub/a/oreilly/frank/rossum_1099.html |url-status=live}}</ref>

<ref name="AutoNT-70">{{cite web |url=https://pypy.org/compat.html |title=PyPy compatibility |publisher=Pypy.org |access-date=3 December 2012 |archive-date=6 June 2020 |archive-url=https://web.archive.org/web/20200606041845/https://www.pypy.org/compat.html |url-status=live}}</ref>

<ref name="AutoNT-71">{{cite web |url=https://speed.pypy.org/ |title=speed comparison between CPython and Pypy |publisher=Speed.pypy.org |access-date=3 December 2012 |archive-date=10 May 2021 |archive-url=https://web.archive.org/web/20210510014902/https://speed.pypy.org/ |url-status=live}}</ref>

<ref name="AutoNT-73">{{cite web |url=http://doc.pypy.org/en/latest/stackless.html |title=Application-level Stackless features – PyPy 2.0.2 documentation |publisher=Doc.pypy.org |access-date=17 July 2013 |archive-date=4 June 2020 |archive-url=https://web.archive.org/web/20200604231513/https://doc.pypy.org/en/latest/stackless.html |url-status=live}}</ref>

<ref name="AutoNT-74">{{cite web |url=https://code.google.com/p/unladen-swallow/wiki/ProjectPlan |title=Plans for optimizing Python |work=Google Project Hosting |date=15 December 2009 |access-date=24 September 2011 |archive-date=11 April 2016 |archive-url=https://web.archive.org/web/20160411181848/https://code.google.com/p/unladen-swallow/wiki/ProjectPlan |url-status=live}}</ref>

<ref name="AutoNT-86">{{cite web |first=Przemyslaw |last=Piotrowski |url=http://www.oracle.com/technetwork/articles/piotrowski-pythoncore-084049.html |title=Build a Rapid Web Development Environment for Python Server Pages and Oracle |work=Oracle Technology Network |publisher=Oracle |date=July 2006 |access-date=12 March 2012 |archive-date=2 April 2019 |archive-url=https://web.archive.org/web/20190402124435/https://www.oracle.com/technetwork/articles/piotrowski-pythoncore-084049.html |url-status=live}}</ref>

<ref name="AutoNT-88">{{cite web |url=https://www.python.org/dev/peps/pep-0327/ |title=PEP 327&nbsp;– Decimal Data Type |last=Batista |first=Facundo |date=17 October 2003 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=24 November 2008 |archive-date=4 June 2020 |archive-url=https://web.archive.org/web/20200604234830/https://www.python.org/dev/peps/pep-0327/ |url-status=live}}</ref>

<ref name="AutoNT-89">{{cite web |url=https://www.python.org/dev/peps/pep-0333/ |title=PEP 333&nbsp;– Python Web Server Gateway Interface v1.0 |last=Eby |first=Phillip J. |date=7 December 2003 |work=Python Enhancement Proposals |publisher=Python Software Foundation |access-date=19 February 2012 |archive-date=14 June 2020 |archive-url=https://web.archive.org/web/20200614170344/https://www.python.org/dev/peps/pep-0333/ |url-status=live}}</ref>

<ref name="AutoNT-90">{{cite web |url=http://boo.codehaus.org/Gotchas+for+Python+Users |title=Gotchas for Python Users |work=boo.codehaus.org |publisher=Codehaus Foundation |access-date=24 November 2008 |url-status=dead |archive-url=https://web.archive.org/web/20081211062108/http://boo.codehaus.org/Gotchas+for+Python+Users |archive-date=11 December 2008}}</ref>

<ref name="AutoNT-91">{{cite web |url=http://cobra-language.com/docs/acknowledgements/ |title=Acknowledgements |last=Esterbrook |first=Charles |work=cobra-language.com |publisher=Cobra Language |access-date=7 April 2010 |archive-date=8 February 2008 |archive-url=https://web.archive.org/web/20080208141002/http://cobra-language.com/docs/acknowledgements/ |url-status=live}}</ref>

<!-- <ref name="AutoNT-92">{{cite web |url=http://cobra-language.com/docs/python/ |title=Comparison to Python |last=Esterbrook |first=Charles |work=cobra-language.com |publisher=Cobra Language |access-date=7 April 2010}}</ref>-->

<ref name="AutoNT-93">{{cite web |url=http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators |archive-url=https://web.archive.org/web/20071020082650/http://wiki.ecmascript.org/doku.php?id=proposals:iterators_and_generators |url-status=dead |archive-date=20 October 2007 |title=Proposals: iterators and generators [ES4 Wiki&#93; |publisher=wiki.ecmascript.org |access-date=24 November 2008}}</ref>

<ref name="AutoNT-94">{{cite news |url=https://techcrunch.com/2009/11/10/google-go-language/ |title=Google's Go: A New Programming Language That's Python Meets C++ |last=Kincaid |first=Jason |date=10 November 2009 |work=TechCrunch |access-date=29 January 2010 |archive-date=18 January 2010 |archive-url=https://web.archive.org/web/20100118014358/http://www.techcrunch.com/2009/11/10/google-go-language/ |url-status=live}}</ref>

<ref name="AutoNT-95">{{cite web |last=Strachan |first=James |date=29 August 2003 |title=Groovy&nbsp;– the birth of a new dynamic language for the Java platform |url=http://radio.weblogs.com/0112098/2003/08/29.html |access-date=11 June 2007 |archive-url=https://web.archive.org/web/20070405085722/http://radio.weblogs.com/0112098/2003/08/29.html |archive-date=5 April 2007 |url-status=dead}}</ref>

<ref name="linuxdevcenter">{{cite web |url=http://www.linuxdevcenter.com/pub/a/linux/2001/11/29/ruby.html |title=An Interview with the Creator of Ruby |publisher=Linuxdevcenter.com |access-date=3 December 2012 |archive-date=28 April 2018 |archive-url=https://web.archive.org/web/20180428150410/http://www.linuxdevcenter.com/pub/a/linux/2001/11/29/ruby.html |url-status=live}}</ref>

<ref name="AutoNT-99">{{cite web |url=http://www.tcl.tk/cgi-bin/tct/tip/3.html |title=TIP #3: TIP Format |last1=Kupries |first1=Andreas |last2=Fellows |first2=Donal K. |work=tcl.tk |publisher=Tcl Developer Xchange |date=14 September 2000 |access-date=24 November 2008 |archive-date=13 July 2017 |archive-url=https://web.archive.org/web/20170713233954/http://tcl.tk/cgi-bin/tct/tip/3.html |url-status=live}}</ref>

<ref name="AutoNT-100">{{cite web |url=http://www.erlang.org/eeps/eep-0001.html |title=EEP 1: EEP Purpose and Guidelines |last1=Gustafsson |first1=Per |last2=Niskanen |first2=Raimo |publisher=erlang.org |date=29 January 2007 |access-date=19 April 2011 |archive-date=15 June 2020 |archive-url=https://web.archive.org/web/20200615153206/http://erlang.org/eeps/eep-0001.html |url-status=live}}</ref>

<ref name="lj-bdfl-resignation">{{cite magazine |url=https://www.linuxjournal.com/content/guido-van-rossum-stepping-down-role-pythons-benevolent-dictator-life |title=Guido van Rossum Stepping Down from Role as Python's Benevolent Dictator For Life |last=Fairchild |first=Carlie |magazine=Linux Journal |date=12 July 2018 |access-date=13 July 2018 |archive-date=13 July 2018 |archive-url=https://web.archive.org/web/20180713192427/https://www.linuxjournal.com/content/guido-van-rossum-stepping-down-role-pythons-benevolent-dictator-life |url-status=live}}</ref>

}}

===Sources===
* {{cite web |url=https://wiki.python.org/moin/PythonForArtificialIntelligence |title=Python for Artificial Intelligence |publisher=Python Wiki |date=19 July 2012 |access-date=3 December 2012 |url-status=dead |archive-url=https://web.archive.org/web/20121101045354/http://wiki.python.org/moin/PythonForArtificialIntelligence |archive-date=1 November 2012}}
* {{cite journal |editor-last=Paine |editor-first=Jocelyn |title=AI in Python |journal=AI Expert Newsletter |publisher=Amzi! |date=August 2005 |url=http://www.ainewsletter.com/newsletters/aix_0508.htm#python_ai_ai |access-date=11 February 2012 |archive-url=https://web.archive.org/web/20120326105810/http://www.ainewsletter.com/newsletters/aix_0508.htm#python_ai_ai |archive-date=26 March 2012 |url-status=dead}}
* {{cite web |url=https://pypi.python.org/pypi/PyAIML |title=PyAIML 0.8.5 : Python Package Index |publisher=Pypi.python.org |access-date=17 July 2013}}
* {{cite book |title=Artificial Intelligence: A Modern Approach |last1=Russell |first1=Stuart J. |author-link1=Stuart J. Russell |last2=Norvig |first2=Peter |author-link2=Peter Norvig |name-list-style=amp |edition=3rd |year=2009 |publisher=Prentice Hall |location=Upper Saddle River, NJ |isbn=978-0-13-604259-4}}

==Further reading==
<!-- THIS IS *NOT* A LIST OF ALL PYTHON BOOKS
According to [[Wikipedia:Further reading]], criteria for inclusion includes:
1. Should clearly qualify as WP:RS, as indicated by reviews and citations to it.
...
5. There should be guidelines on limiting the number of sources.
6. To avoid spam, any book included should have received more than one good review in RS: newspapers and scholarly journals being the norm, and the clear balance of RS reviews should be positive. This would avoid self-publish spamming, POV pushing, and attempts by publishers to get books promoted through inclusion on Wikipedia. At the moment "editorial recommendations" as described in the manual smacks of OR.
7. Neutrality on the part of editors is essential. In terms of major debates, items representing all major positions should be included, with annotations indicating the specific POV of each. We may have to work out rules where topic disputes are irreconcilable.
-->
* {{cite book |last=Downey |first=Allen B. |title=Think Python: How to Think Like a Computer Scientist |edition=<!-- rather show here latest: version 2.0.17 ? --->version 1.6.6 |date=May 2012 |publisher=Cambridge University Press |isbn=978-0-521-72596-5}}
* {{cite news |url=http://www.computerworld.com.au/index.php/id;66665771 |title=The A-Z of Programming Languages: Python |last=Hamilton |first=Naomi |date=5 August 2008 |work=Computerworld |access-date=31 March 2010 |url-status=dead |archive-url=https://web.archive.org/web/20081229095320/http://www.computerworld.com.au/index.php/id%3B66665771 |archive-date=29 December 2008}}
* {{cite book |last=Lutz |first=Mark |title=Learning Python |publisher=O'Reilly Media |year=2013 |edition=5th |isbn=978-0-596-15806-4}}
* {{cite book |last=Summerfield |first=Mark |title=Programming in Python 3 |publisher=Addison-Wesley Professional|year=2009|edition=2nd|isbn=978-0-321-68056-3}}
* {{cite book |last=Ramalho |first=Luciano |title=Fluent Python |url=https://www.thoughtworks.com/insights/books/fluent-python-2nd-edition |date=May 2022 |publisher=O'Reilly Media |isbn=978-1-4920-5632-4}}


==External links==
==External links==
<!--
{{wikibooks|Python Programming}}
{{Commonscat}}
{{No more links}}
PLEASE BE CAUTIOUS IN ADDING MORE LINKS TO THIS ARTICLE. Wikipedia is not a collection of links nor should it be used for advertising.
{{wikiversity|Python Programming}}
{{wikiquote|Python}}
* [http://www.python.org/ Python Official Website]
* [http://www.python.org/doc/ Official documentation and resources]
* [http://www.computerworld.com.au/index.php/id;66665771 Computerworld Interview with Guido Van Rossum on Python]
* {{dmoz|Computers/Programming/Languages/Python|Python}}


Excessive or inappropriate links WILL BE DELETED. See [[Wikipedia:External links]] & [[Wikipedia:Spam]] for details.
<!--===========================({{NoMoreLinks}})===============================

| PLEASE BE CAUTIOUS IN ADDING MORE LINKS TO THIS ARTICLE. WIKIPEDIA IS |
If there are already plentiful links, please propose additions or replacements on this article's discussion page, or submit your link to the relevant category at Curlie, formerly the Open Directory Project (dmoz.org) and link back to that category using the {{Curlie}} template.
| NOT A COLLECTION OF LINKS. |
{{No more links}}
| |
-->
| Excessive or inappropriate links WILL BE DELETED. |

| See [[Wikipedia:External links]] and [[Wikipedia:Spam]] for details. |
{{Sister project links |wikt=no |display=Python |commons=Category:Python (programming language) |b=Python Programming |n=no |s=no |voy=no |species=no |d=Q28865}}
| |
* {{Official website}}
| If there are already plentiful links, please propose additions or |

| replacements on this article's discussion page. Or submit your link |
{{Python (programming language)|state=expanded}}
| to the appropriate category at the Open Directory Project (www.dmoz.org)|
{{Programming languages}}
| and link back to that category using the {{dmoz}} template. |
{{Python web frameworks}}
===========================({{NoMoreLinks}})===============================-->
{{Differentiable computing}}
{{FOSS}}
{{FOSS}}
{{Statistical software}}
{{Numerical analysis software}}
{{Authority control}}


[[Category:Python programming language| ]]
[[Category:Python (programming language)| ]]
[[Category:Articles with example Python (programming language) code]]
[[Category:Class-based programming languages]]
[[Category:Class-based programming languages]]
[[Category:Notebook interface]]
[[Category:Computer science in the Netherlands]]
[[Category:Concurrent programming languages]]
[[Category:Cross-platform free software]]
[[Category:Cross-platform software]]
[[Category:Dutch inventions]]
[[Category:Dynamically typed programming languages]]
[[Category:Educational programming languages]]
[[Category:High-level programming languages]]
[[Category:Information technology in the Netherlands]]
[[Category:Multi-paradigm programming languages]]
[[Category:Object-oriented programming languages]]
[[Category:Object-oriented programming languages]]
[[Category:Dynamically-typed programming languages]]
[[Category:Pattern matching programming languages]]
[[Category:Programming languages]]
[[Category:Programming languages created in 1991]]
[[Category:Scripting languages]]
[[Category:Scripting languages]]
[[Category:Unix software]]
[[Category:Text-oriented programming languages]]

{{Link FA|ru}}

[[ar:بايثون]]
[[an:Python]]
[[az:Python]]
[[bs:Python programski jezik]]
[[bg:Python]]
[[ca:Python]]
[[cs:Python]]
[[da:Python (programmeringssprog)]]
[[de:Python (Programmiersprache)]]
[[el:Python]]
[[es:Python]]
[[et:Python (programmeerimiskeel)]]
[[eo:Python (programlingvo)]]
[[eu:Python]]
[[fa:زبان برنامه‌نویسی پایتون]]
[[fr:Python (langage)]]
[[gl:Python]]
[[ko:파이썬]]
[[is:Python (forritunarmál)]]
[[it:Python]]
[[he:Python]]
[[ka:პითონი (პროგრამირების ენა)]]
[[la:Python]]
[[lt:Python]]
[[hu:Python (programozási nyelv)]]
[[ml:പൈത്തണ്‍]]
[[ms:Python]]
[[nl:Python (programmeertaal)]]
[[ja:Python]]
[[no:Python]]
[[pl:Python]]
[[pt:Python]]
[[ro:Python]]
[[ru:Python]]
[[sq:Python]]
[[simple:Python (programming language)]]
[[sk:Python (programovací jazyk)]]
[[sl:Python (programski jezik)]]
[[sr:Програмски језик Пајтон]]
[[fi:Python]]
[[sv:Python (programspråk)]]
[[ta:பைத்தோன்]]
[[te:పైథాన్ (కంప్యూటర్ భాష)]]
[[th:ภาษาไพทอน]]
[[vi:Python (ngôn ngữ lập trình)]]
[[tr:Python (programlama dili)]]
[[bug:Python]]
[[uk:Python]]
[[zh:Python]]

Latest revision as of 00:54, 1 June 2024

Python
ParadigmMulti-paradigm: object-oriented,[1] procedural (imperative), functional, structured, reflective
Designed byGuido van Rossum
DeveloperPython Software Foundation
First appeared20 February 1991; 33 years ago (1991-02-20)[2]
Stable release
3.12.3 Edit this on Wikidata / 9 April 2024; 53 days ago (9 April 2024)
Typing disciplineduck, dynamic, strong;[3] optional type annotations (since 3.5, but those hints are ignored, except with unofficial tools)[4]
OSTier 1: 64-bit Linux, macOS; 64- and 32-bit Windows 10+[5]
Tier 2: E.g. 32-bit WebAssembly (WASI) Tier 3: 64-bit FreeBSD, iOS; e.g. Raspberry Pi OS
Unofficial (or has been known to work): Other Unix-like/BSD variants and e.g. Android 5.0+ (official from Python 3.13 planned[6]) and a few other platforms[7][8][9]
LicensePython Software Foundation License
Filename extensions.py, .pyw, .pyz,[10]
.pyi, .pyc, .pyd
Websitepython.org
Major implementations
CPython, PyPy, Stackless Python, MicroPython, CircuitPython, IronPython, Jython
Dialects
Cython, RPython, Starlark[11]
Influenced by
ABC,[12] Ada,[13] ALGOL 68,[14]
APL,[15] C,[16] C++,[17] CLU,[18] Dylan,[19]
Haskell,[20][15] Icon,[21] Lisp,[22]
Modula-3
,[14][17] Perl,[23] Standard ML[15]
Influenced
Apache Groovy, Boo, Cobra, CoffeeScript,[24] D, F#, GDScript, Genie,[25] Go, JavaScript,[26][27] Julia,[28] Mojo,[29] Nim, Ring,[30] Ruby,[31] Swift[32]

Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.[33]

Python is dynamically typed and garbage-collected. It supports multiple programming paradigms, including structured (particularly procedural), object-oriented and functional programming. It is often described as a "batteries included" language due to its comprehensive standard library.[34][35]

Guido van Rossum began working on Python in the late 1980s as a successor to the ABC programming language and first released it in 1991 as Python 0.9.0.[36] Python 2.0 was released in 2000. Python 3.0, released in 2008, was a major revision not completely backward-compatible with earlier versions. Python 2.7.18, released in 2020, was the last release of Python 2.[37]

Python consistently ranks as one of the most popular programming languages, and has gained widespread use in the machine learning community.[38][39][40][41]

History[edit]

The designer of Python, Guido van Rossum, at OSCON 2006

Python was invented in the late 1980s[42] by Guido van Rossum at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a successor to the ABC programming language, which was inspired by SETL,[43] capable of exception handling and interfacing with the Amoeba operating system.[12] Its implementation began in December 1989.[44] Van Rossum shouldered sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from his responsibilities as Python's "benevolent dictator for life" (BDFL), a title the Python community bestowed upon him to reflect his long-term commitment as the project's chief decision-maker[45] (he's since come out of retirement and is self-titled "BDFL-emeritus"). In January 2019, active Python core developers elected a five-member Steering Council to lead the project.[46][47]

Python 2.0 was released on 16 October 2000, with many major new features such as list comprehensions, cycle-detecting garbage collection, reference counting, and Unicode support.[48] Python 3.0, released on 3 December 2008, with many of its major features backported to Python 2.6.x[49] and 2.7.x. Releases of Python 3 include the 2to3 utility, which automates the translation of Python 2 code to Python 3.[50]

Python 2.7's end-of-life was initially set for 2015, then postponed to 2020 out of concern that a large body of existing code could not easily be forward-ported to Python 3.[51][52] No further security patches or other improvements will be released for it.[53][54] Currently only 3.8 and later are supported (2023 security issues were fixed in e.g. 3.7.17, the final 3.7.x release[55]). While Python 2.7 and older is officially unsupported, a different unofficial Python implementation, PyPy, continues to support Python 2, i.e. "2.7.18+" (plus 3.9 and 3.10), with the plus meaning (at least some) "backported security updates".[56]

In 2021 (and again twice in 2022), security updates were expedited, since all Python versions were insecure (including 2.7[57]) because of security issues leading to possible remote code execution[58] and web-cache poisoning.[59] In 2022, Python 3.10.4 and 3.9.12 were expedited[60] and 3.8.13, because of many security issues.[61] When Python 3.9.13 was released in May 2022, it was announced that the 3.9 series (joining the older series 3.8 and 3.7) would only receive security fixes in the future.[62] On 7 September 2022, four new releases were made due to a potential denial-of-service attack: 3.10.7, 3.9.14, 3.8.14, and 3.7.14.[63][64]

As of October 2023, Python 3.12 is the stable release, and 3.12 and 3.11 are the only versions with active (as opposed to just security) support. Notable changes in 3.11 from 3.10 include increased program execution speed and improved error reporting.[65]

Python 3.12 adds syntax (and in fact every Python since at least 3.5 adds some syntax) to the language, the new (soft) keyword type (recent releases have added a lot of typing support e.g. new type union operator in 3.10), and 3.11 for exception handling, and 3.10 the match and case (soft) keywords, for structural pattern matching statements. Python 3.12 also drops outdated modules and functionality, and future versions will too, see below in Development section.

Python 3.11 claims to be between 10 and 60% faster than Python 3.10, and Python 3.12 adds another 5% on top of that. It also has improved error messages, and many other changes.

Since 27 June 2023, Python 3.8 is the oldest supported version of Python (albeit in the 'security support' phase), due to Python 3.7 reaching end-of-life.[66]

Python 3.13 introduced an incremental (shorter pauses for collection in programs with a lot of objects) garbage collector, an experimental JIT compiler;,[67] and removals from the C API. Some standard library modules, 19 dead batteries, and many deprecated classes, functions and methods, and more will be removed in Python 3.15 and or 3.16.[68] Starting with 3.13, it and later versions have 2 years of full support (up from one and a half); followed by 3 years of security support (for same total support as before).

Design philosophy and features[edit]

Python is a multi-paradigm programming language. Object-oriented programming and structured programming are fully supported, and many of their features support functional programming and aspect-oriented programming (including metaprogramming[69] and metaobjects).[70] Many other paradigms are supported via extensions, including design by contract[71][72] and logic programming.[73]

Python uses dynamic typing and a combination of reference counting and a cycle-detecting garbage collector for memory management.[74] It uses dynamic name resolution (late binding), which binds method and variable names during program execution.

Its design offers some support for functional programming in the Lisp tradition. It has filter,mapandreduce functions; list comprehensions, dictionaries, sets, and generator expressions.[75] The standard library has two modules (itertools and functools) that implement functional tools borrowed from Haskell and Standard ML.[76]

Its core philosophy is summarized in the Zen of Python (PEP 20), which includes aphorisms such as:[77]

  • Beautiful is better than ugly.
  • Explicit is better than implicit.
  • Simple is better than complex.
  • Complex is better than complicated.
  • Readability counts.

However, Python features regularly violate these principles and received criticism for adding unnecessary language bloat.[78][79] Responses to these criticisms are that the Zen of Python is a guideline rather than a rule.[80] The addition of some new features had been so controversial that Guido van Rossum resigned as Benevolent Dictator for Life following vitriol over the addition of the assignment expression operator in Python 3.8.[81][82]

Nevertheless, rather than building all of its functionality into its core, Python was designed to be highly extensible via modules. This compact modularity has made it particularly popular as a means of adding programmable interfaces to existing applications. Van Rossum's vision of a small core language with a large standard library and easily extensible interpreter stemmed from his frustrations with ABC, which espoused the opposite approach.[42]

Python claims to strive for a simpler, less-cluttered syntax and grammar while giving developers a choice in their coding methodology. In contrast to Perl's "there is more than one way to do it" motto, Python embraces a "there should be one—and preferably only one—obvious way to do it." philosophy.[77] In practice, however, Python provides many ways to achieve the same task. There are, for example, at least three ways to format a string literal, with no certainty as to which one a programmer should use.[83] Alex Martelli, a Fellow at the Python Software Foundation and Python book author, wrote: "To describe something as 'clever' is not considered a compliment in the Python culture."[84]

Python's developers usually strive to avoid premature optimization and reject patches to non-critical parts of the CPython reference implementation that would offer marginal increases in speed at the cost of clarity.[85] Execution speed can be improved by moving speed-critical functions to extension modules written in languages such as C, or by using a just-in-time compiler like PyPy. It is also possible to cross-compile to other languages, but it either doesn't provide the full speed-up that might be expected, since Python is a very dynamic language, or a restricted subset of Python is compiled, and possibly semantics are slightly changed.[86]

Python's developers aim for it to be fun to use. This is reflected in its name—a tribute to the British comedy group Monty Python[87]—and in occasionally playful approaches to tutorials and reference materials, such as the use of the terms "spam" and "eggs" (a reference to a Monty Python sketch) in examples, instead of the often-used "foo" and "bar".[88][89] A common neologism in the Python community is pythonic, which has a wide range of meanings related to program style. "Pythonic" code may use Python idioms well, be natural or show fluency in the language, or conform with Python's minimalist philosophy and emphasis on readability. Code that is difficult to understand or reads like a rough transcription from another programming language is called unpythonic.[90][91]

Syntax and semantics[edit]

Python is meant to be an easily readable language. Its formatting is visually uncluttered and often uses English keywords where other languages use punctuation. Unlike many other languages, it does not use curly brackets to delimit blocks, and semicolons after statements are allowed but rarely used. It has fewer syntactic exceptions and special cases than C or Pascal.[92]

Indentation[edit]

Python uses whitespace indentation, rather than curly brackets or keywords, to delimit blocks. An increase in indentation comes after certain statements; a decrease in indentation signifies the end of the current block.[93] Thus, the program's visual structure accurately represents its semantic structure.[94] This feature is sometimes termed the off-side rule. Some other languages use indentation this way; but in most, indentation has no semantic meaning. The recommended indent size is four spaces.[95]

Statements and control flow[edit]

Python's statements include:

  • The assignment statement, using a single equals sign =
  • The if statement, which conditionally executes a block of code, along with else and elif (a contraction of else-if)
  • The for statement, which iterates over an iterable object, capturing each element to a local variable for use by the attached block
  • The while statement, which executes a block of code as long as its condition is true
  • The try statement, which allows exceptions raised in its attached code block to be caught and handled by except clauses (or new syntax except* in Python 3.11 for exception groups[96]); it also ensures that clean-up code in a finally block is always run regardless of how the block exits
  • The raise statement, used to raise a specified exception or re-raise a caught exception
  • The class statement, which executes a block of code and attaches its local namespace to a class, for use in object-oriented programming
  • The def statement, which defines a function or method
  • The with statement, which encloses a code block within a context manager (for example, acquiring a lock before it is run, then releasing the lock; or opening and closing a file), allowing resource-acquisition-is-initialization (RAII)-like behavior and replacing a common try/finally idiom[97]
  • The break statement, which exits a loop
  • The continue statement, which skips the rest of the current iteration and continues with the next
  • The del statement, which removes a variable—deleting the reference from the name to the value, and producing an error if the variable is referred to before it is redefined
  • The pass statement, serving as a NOP, syntactically needed to create an empty code block
  • The assert statement, used in debugging to check for conditions that should apply
  • The yield statement, which returns a value from a generator function (and also an operator); used to implement coroutines
  • The return statement, used to return a value from a function
  • The import and from statements, used to import modules whose functions or variables can be used in the current program

The assignment statement (=) binds a name as a reference to a separate, dynamically allocated object. Variables may subsequently be rebound at any time to any object. In Python, a variable name is a generic reference holder without a fixed data type; however, it always refers to some object with a type. This is called dynamic typing—in contrast to statically-typed languages, where each variable may contain only a value of a certain type.

Python does not support tail call optimization or first-class continuations, and, according to Van Rossum, it never will.[98][99] However, better support for coroutine-like functionality is provided by extending Python's generators.[100] Before 2.5, generators were lazy iterators; data was passed unidirectionally out of the generator. From Python 2.5 on, it is possible to pass data back into a generator function; and from version 3.3, it can be passed through multiple stack levels.[101]

Expressions[edit]

Python's expressions include:

  • The +, -, and * operators for mathematical addition, subtraction, and multiplication are similar to other languages, but the behavior of division differs. There are two types of divisions in Python: floor division (or integer division) // and floating-point/division.[102] Python uses the ** operator for exponentiation.
  • Python uses the + operator for string concatenation. Python uses the * operator for duplicating a string a specified number of times.
  • The @ infix operator. It is intended to be used by libraries such as NumPy for matrix multiplication.[103][104]
  • The syntax :=, called the "walrus operator", was introduced in Python 3.8. It assigns values to variables as part of a larger expression.[105]
  • In Python, == compares by value. Python's is operator may be used to compare object identities (comparison by reference), and comparisons may be chained—for example, a <= b <= c.
  • Python uses and, or, and not as Boolean operators.
  • Python has a type of expression named a list comprehension, and a more general expression named a generator expression.[75]
  • Anonymous functions are implemented using lambda expressions; however, there may be only one expression in each body.
  • Conditional expressions are written as x if c else y[106] (different in order of operands from the c ? x : y operator common to many other languages).
  • Python makes a distinction between lists and tuples. Lists are written as [1, 2, 3], are mutable, and cannot be used as the keys of dictionaries (dictionary keys must be immutable in Python). Tuples, written as (1, 2, 3), are immutable and thus can be used as keys of dictionaries, provided all of the tuple's elements are immutable. The + operator can be used to concatenate two tuples, which does not directly modify their contents, but produces a new tuple containing the elements of both. Thus, given the variable t initially equal to (1, 2, 3), executing t = t + (4, 5) first evaluates t + (4, 5), which yields (1, 2, 3, 4, 5), which is then assigned back to t—thereby effectively "modifying the contents" of t while conforming to the immutable nature of tuple objects. Parentheses are optional for tuples in unambiguous contexts.[107]
  • Python features sequence unpacking where multiple expressions, each evaluating to anything that can be assigned (to a variable, writable property, etc.) are associated in an identical manner to that forming tuple literals—and, as a whole, are put on the left-hand side of the equal sign in an assignment statement. The statement expects an iterable object on the right-hand side of the equal sign that produces the same number of values as the provided writable expressions; when iterated through them, it assigns each of the produced values to the corresponding expression on the left.[108]
  • Python has a "string format" operator % that functions analogously to printf format strings in C—e.g. "spam=%s eggs=%d" % ("blah", 2) evaluates to "spam=blah eggs=2". In Python 2.6+ and 3+, this was supplemented by the format() method of the str class, e.g. "spam={0} eggs={1}".format("blah", 2). Python 3.6 added "f-strings": spam = "blah"; eggs = 2; f'spam={spam} eggs={eggs}'.[109]
  • Strings in Python can be concatenated by "adding" them (with the same operator as for adding integers and floats), e.g. "spam" + "eggs" returns "spameggs". If strings contain numbers, they are added as strings rather than integers, e.g. "2" + "2" returns "22".
  • Python has various string literals:
    • Delimited by single or double quotes; unlike in Unix shells, Perl, and Perl-influenced languages, single and double quotes work the same. Both use the backslash (\) as an escape character. String interpolation became available in Python 3.6 as "formatted string literals".[109]
    • Triple-quoted (beginning and ending with three single or double quotes), which may span multiple lines and function like here documents in shells, Perl, and Ruby.
    • Raw string varieties, denoted by prefixing the string literal with r. Escape sequences are not interpreted; hence raw strings are useful where literal backslashes are common, such as regular expressions and Windows-style paths. (Compare "@-quoting" in C#.)
  • Python has array index and array slicing expressions in lists, denoted as a[key], a[start:stop] or a[start:stop:step]. Indexes are zero-based, and negative indexes are relative to the end. Slices take elements from the start index up to, but not including, the stop index. The third slice parameter, called step or stride, allows elements to be skipped and reversed. Slice indexes may be omitted—for example, a[:] returns a copy of the entire list. Each element of a slice is a shallow copy.

In Python, a distinction between expressions and statements is rigidly enforced, in contrast to languages such as Common Lisp, Scheme, or Ruby. This leads to duplicating some functionality. For example:

  • List comprehensions vs. for-loops
  • Conditional expressions vs. if blocks
  • The eval() vs. exec() built-in functions (in Python 2, exec is a statement); the former is for expressions, the latter is for statements

Statements cannot be a part of an expression—so list and other comprehensions or lambda expressions, all being expressions, cannot contain statements. A particular case is that an assignment statement such as a = 1 cannot form part of the conditional expression of a conditional statement.

Methods[edit]

Methods on objects are functions attached to the object's class; the syntax instance.method(argument) is, for normal methods and functions, syntactic sugar for Class.method(instance, argument). Python methods have an explicit self parameter to access instance data, in contrast to the implicit self (or this) in some other object-oriented programming languages (e.g., C++, Java, Objective-C, Ruby).[110] Python also provides methods, often called dunder methods (due to their names beginning and ending with double-underscores), to allow user-defined classes to modify how they are handled by native operations including length, comparison, in arithmetic operations and type conversion.[111]

Typing[edit]

The standard type hierarchy in Python 3

Python uses duck typing and has typed objects but untyped variable names. Type constraints are not checked at compile time; rather, operations on an object may fail, signifying that it is not of a suitable type. Despite being dynamically typed, Python is strongly typed, forbidding operations that are not well-defined (for example, adding a number to a string) rather than silently attempting to make sense of them.

Python allows programmers to define their own types using classes, most often used for object-oriented programming. New instances of classes are constructed by calling the class (for example, SpamClass() or EggsClass()), and the classes are instances of the metaclass type (itself an instance of itself), allowing metaprogramming and reflection.

Before version 3.0, Python had two kinds of classes (both using the same syntax): old-style and new-style;[112] current Python versions only support the semantics of the new style.

Python supports optional type annotations.[4][113] These annotations are not enforced by the language, but may be used by external tools such as mypy to catch errors.[114][115] Mypy also supports a Python compiler called mypyc, which leverages type annotations for optimization.[116]

Summary of Python 3's built-in types
Type Mutability Description Syntax examples
bool immutable Boolean value True
False
bytearray mutable Sequence of bytes bytearray(b'Some ASCII')
bytearray(b"Some ASCII")
bytearray([119, 105, 107, 105])
bytes immutable Sequence of bytes b'Some ASCII'
b"Some ASCII"
bytes([119, 105, 107, 105])
complex immutable Complex number with real and imaginary parts 3+2.7j
3 + 2.7j
dict mutable Associative array (or dictionary) of key and value pairs; can contain mixed types (keys and values), keys must be a hashable type {'key1': 1.0, 3: False}
{}
types.EllipsisType immutable An ellipsis placeholder to be used as an index in NumPy arrays ...
Ellipsis
float immutable Double-precision floating-point number. The precision is machine-dependent but in practice is generally implemented as a 64-bit IEEE 754 number with 53 bits of precision.[117]

1.33333

frozenset immutable Unordered set, contains no duplicates; can contain mixed types, if hashable frozenset([4.0, 'string', True])
int immutable Integer of unlimited magnitude[118] 42
list mutable List, can contain mixed types [4.0, 'string', True]
[]
types.NoneType immutable An object representing the absence of a value, often called null in other languages None
types.NotImplementedType immutable A placeholder that can be returned from overloaded operators to indicate unsupported operand types. NotImplemented
range immutable An immutable sequence of numbers commonly used for looping a specific number of times in for loops[119] range(-1, 10)
range(10, -5, -2)
set mutable Unordered set, contains no duplicates; can contain mixed types, if hashable {4.0, 'string', True}
set()
str immutable A character string: sequence of Unicode codepoints 'Wikipedia'
"Wikipedia"
"""Spanning
multiple
lines"""
Spanning
multiple
lines
tuple immutable Can contain mixed types (4.0, 'string', True)
('single element',)
()

Arithmetic operations[edit]

Python has the usual symbols for arithmetic operators (+, -, *, /), the floor division operator // and the modulo operation % (where the remainder can be negative, e.g. 4 % -3 == -2). It also has ** for exponentiation, e.g. 5**3 == 125 and 9**0.5 == 3.0, and a matrix‑multiplication operator @ .[120] These operators work like in traditional math; with the same precedence rules, the operators infix (+ and - can also be unary to represent positive and negative numbers respectively).

The division between integers produces floating-point results. The behavior of division has changed significantly over time:[121]

  • Current Python (i.e. since 3.0) changed / to always be floating-point division, e.g. 5/2 == 2.5.
  • The floor division // operator was introduced. So 7//3 == 2, -7//3 == -3, 7.5//3 == 2.0 and -7.5//3 == -3.0. Adding from __future__ import division causes a module used in Python 2.7 to use Python 3.0 rules for division (see above).

In Python terms, / is true division (or simply division), and // is floor division. / before version 3.0 is classic division.[121]

Rounding towards negative infinity, though different from most languages, adds consistency. For instance, it means that the equation (a + b)//b == a//b + 1 is always true. It also means that the equation b*(a//b) + a%b == a is valid for both positive and negative values of a. However, maintaining the validity of this equation means that while the result of a%b is, as expected, in the half-open interval [0, b), where b is a positive integer, it has to lie in the interval (b, 0] when b is negative.[122]

Python provides a round function for rounding a float to the nearest integer. For tie-breaking, Python 3 uses round to even: round(1.5) and round(2.5) both produce 2.[123] Versions before 3 used round-away-from-zero: round(0.5) is 1.0, round(-0.5) is −1.0.[124]

Python allows Boolean expressions with multiple equality relations in a manner that is consistent with general use in mathematics. For example, the expression a < b < c tests whether a is less than b and b is less than c.[125] C-derived languages interpret this expression differently: in C, the expression would first evaluate a < b, resulting in 0 or 1, and that result would then be compared with c.[126]

Python uses arbitrary-precision arithmetic for all integer operations. The Decimal type/class in the decimal module provides decimal floating-point numbers to a pre-defined arbitrary precision and several rounding modes.[127] The Fraction class in the fractions module provides arbitrary precision for rational numbers.[128]

Due to Python's extensive mathematics library, and the third-party library NumPy that further extends the native capabilities, it is frequently used as a scientific scripting language to aid in problems such as numerical data processing and manipulation.[129][130]

Programming examples[edit]

"Hello, World!" program:

print('Hello, world!')

Program to calculate the factorial of a positive integer:

n = int(input('Type a number, and its factorial will be printed: '))

if n < 0:
    raise ValueError('You must enter a non-negative integer')

factorial = 1
for i in range(2, n + 1):
    factorial *= i

print(factorial)

Libraries[edit]

Python's large standard library[131] provides tools suited to many tasks and is commonly cited as one of its greatest strengths. For Internet-facing applications, many standard formats and protocols such as MIME and HTTP are supported. It includes modules for creating graphical user interfaces, connecting to relational databases, generating pseudorandom numbers, arithmetic with arbitrary-precision decimals,[127] manipulating regular expressions, and unit testing.

Some parts of the standard library are covered by specifications—for example, the Web Server Gateway Interface (WSGI) implementation wsgiref follows PEP 333[132]—but most are specified by their code, internal documentation, and test suites. However, because most of the standard library is cross-platform Python code, only a few modules need altering or rewriting for variant implementations.

As of 17 March 2024, the Python Package Index (PyPI), the official repository for third-party Python software, contains over 523,000[133] packages with a wide range of functionality, including:

Development environments[edit]

Most Python implementations (including CPython) include a read–eval–print loop (REPL), permitting them to function as a command line interpreter for which users enter statements sequentially and receive results immediately.

Python also comes with an Integrated development environment (IDE) called IDLE, which is more beginner-oriented.

Other shells, including IDLE and IPython, add further abilities such as improved auto-completion, session state retention, and syntax highlighting.

As well as standard desktop integrated development environments including PyCharm, IntelliJ Idea, Visual Studio Code etc, there are web browser-based IDEs, including SageMath, for developing science- and math-related programs; PythonAnywhere, a browser-based IDE and hosting environment; and Canopy IDE, a commercial IDE emphasizing scientific computing.[134]

Implementations[edit]

Reference implementation[edit]

CPython is the reference implementation of Python. It is written in C, meeting the C89 standard (Python 3.11 uses C11[135]) with several select C99 features. CPython includes its own C extensions, but third-party extensions are not limited to older C versions—e.g. they can be implemented with C11 or C++.[136][137] CPython compiles Python programs into an intermediate bytecode[138] which is then executed by its virtual machine.[139] CPython is distributed with a large standard library written in a mixture of C and native Python, and is available for many platforms, including Windows (starting with Python 3.9, the Python installer deliberately fails to install on Windows 7 and 8;[140][141] Windows XP was supported until Python 3.5) and most modern Unix-like systems, including macOS (and Apple M1 Macs, since Python 3.9.1, with experimental installer), with unofficial support for VMS.[142] Platform portability was one of its earliest priorities.[143] (During Python 1 and 2 development, even OS/2 and Solaris were supported,[144] but support has since been dropped for many platforms.)

Python, since 3.7, only supports operating systems with multi-threading support.

Other implementations[edit]

  • PyPy is a fast, compliant interpreter of Python 2.7 and 3.8.[145][146] Its just-in-time compiler often brings a significant speed improvement over CPython, but some libraries written in C cannot be used with it.[147]
  • Stackless Python is a significant fork of CPython that implements microthreads; it does not use the call stack in the same way, thus allowing massively concurrent programs. PyPy also has a stackless version.[148]
  • MicroPython and CircuitPython are Python 3 variants optimized for microcontrollers, including Lego Mindstorms EV3.[149]
  • Pyston is a variant of the Python runtime that uses just-in-time compilation to speed up the execution of Python programs.[150]
  • Cinder is a performance-oriented fork of CPython 3.8 that contains a number of optimizations, including bytecode inline caching, eager evaluation of coroutines, a method-at-a-time JIT, and an experimental bytecode compiler.[151]
  • Snek[152][153][154] Embedded Computing Language (compatible with e.g. 8-bit AVR microcontrollers such as ATmega 328P-based Arduino, as well as larger ones compatible with MicroPython) "is Python-inspired, but it is not Python. It is possible to write Snek programs that run under a full Python system, but most Python programs will not run under Snek."[155] It is an imperative language not including OOP / classes, unlike Python, and simplifying to one number type with 32-bit single-precision (similar to JavaScript, except smaller).

Unsupported implementations[edit]

Other just-in-time Python compilers have been developed, but are now unsupported:

  • Google began a project named Unladen Swallow in 2009, with the aim of speeding up the Python interpreter five-fold by using the LLVM, and of improving its multithreading ability to scale to thousands of cores,[156] while ordinary implementations suffer from the global interpreter lock.
  • Psyco is a discontinued just-in-time specializing compiler that integrates with CPython and transforms bytecode to machine code at runtime. The emitted code is specialized for certain data types and is faster than the standard Python code. Psyco does not support Python 2.7 or later.
  • PyS60 was a Python 2 interpreter for Series 60 mobile phones released by Nokia in 2005. It implemented many of the modules from the standard library and some additional modules for integrating with the Symbian operating system. The Nokia N900 also supports Python with GTK widget libraries, enabling programs to be written and run on the target device.[157]

Cross-compilers to other languages[edit]

There are several compilers/transpilers to high-level object languages, with either unrestricted Python, a restricted subset of Python, or a language similar to Python as the source language:

  • Brython,[158] Transcrypt[159][160] and Pyjs (latest release in 2012) compile Python to JavaScript.
  • Codon compiles a subset of statically typed Python[161] to machine code (via LLVM) and supports native multithreading.[162]
  • Cython compiles (a superset of) Python to C. The resulting code is also usable with Python via direct C-level API calls into the Python interpreter.
  • PyJL compiles/transpiles a subset of Python to "human-readable, maintainable, and high-performance Julia source code".[86] Despite claiming high performance, no tool can claim to do that for arbitrary Python code; i.e. it's known not possible to compile to a faster language or machine code. Unless semantics of Python are changed, but in many cases speedup is possible with few or no changes in the Python code. The faster Julia source code can then be used from Python, or compiled to machine code, and based that way.
  • Nuitka compiles Python into C.[163]
  • Numba uses LLVM to compile a subset of Python to machine code.
  • Pythran compiles a subset of Python 3 to C++ (C++11).[164]
  • RPython can be compiled to C, and is used to build the PyPy interpreter of Python.
  • The Python → 11l → C++ transpiler[165] compiles a subset of Python 3 to C++ (C++17).

Specialized:

Older projects (or not to be used with Python 3.x and latest syntax):

  • Google's Grumpy (latest release in 2017) transpiles Python 2 to Go.[166][167][168]
  • IronPython allows running Python 2.7 programs (and an alpha, released in 2021, is also available for "Python 3.4, although features and behaviors from later versions may be included"[169]) on the .NET Common Language Runtime.[170]
  • Jython compiles Python 2.7 to Java bytecode, allowing the use of the Java libraries from a Python program.[171]
  • Pyrex (latest release in 2010) and Shed Skin (latest release in 2013) compile to C and C++ respectively.

Performance[edit]

Performance comparison of various Python implementations on a non-numerical (combinatorial) workload was presented at EuroSciPy '13.[172] Python's performance compared to other programming languages is also benchmarked by The Computer Language Benchmarks Game.[173]

Development[edit]

Python's development is conducted largely through the Python Enhancement Proposal (PEP) process, the primary mechanism for proposing major new features, collecting community input on issues, and documenting Python design decisions.[174] Python coding style is covered in PEP 8.[175] Outstanding PEPs are reviewed and commented on by the Python community and the steering council.[174]

Enhancement of the language corresponds with the development of the CPython reference implementation. The mailing list python-dev is the primary forum for the language's development. Specific issues were originally discussed in the Roundup bug tracker hosted at by the foundation.[176] In 2022, all issues and discussions were migrated to GitHub.[177] Development originally took place on a self-hosted source-code repository running Mercurial, until Python moved to GitHub in January 2017.[178]

CPython's public releases come in three types, distinguished by which part of the version number is incremented:

  • Backward-incompatible versions, where code is expected to break and needs to be manually ported. The first part of the version number is incremented. These releases happen infrequently—version 3.0 was released 8 years after 2.0. According to Guido van Rossum, a version 4.0 is very unlikely to ever happen.[179]
  • Major or "feature" releases are largely compatible with the previous version but introduce new features. The second part of the version number is incremented. Starting with Python 3.9, these releases are expected to happen annually.[180][181] Each major version is supported by bug fixes for several years after its release.[182]
  • Bugfix releases,[183] which introduce no new features, occur about every 3 months and are made when a sufficient number of bugs have been fixed upstream since the last release. Security vulnerabilities are also patched in these releases. The third and final part of the version number is incremented.[183]

Many alpha, beta, and release-candidates are also released as previews and for testing before final releases. Although there is a rough schedule for each release, they are often delayed if the code is not ready. Python's development team monitors the state of the code by running the large unit test suite during development.[184]

The major academic conference on Python is PyCon. There are also special Python mentoring programs, such as PyLadies.

Python 3.12 removed wstr meaning Python extensions[185] need to be modified,[186] and 3.10 added pattern matching to the language.[187]

Python 3.12 dropped some outdated modules, and more will be dropped in the future, deprecated as of 3.13; already deprecated array 'u' format code will emit DeprecationWarning since 3.13 and will be removed in Python 3.16. The 'w' format code should be used instead. Part of ctypes is also deprecated and http.server.CGIHTTPRequestHandler will emit a DeprecationWarning, and will be removed in 3.15. Using that code already has a high potential for both security and functionality bugs. Parts of the typing module are deprecated, e.g. creating a typing.NamedTuple class using keyword arguments to denote the fields and such (and more) will be disallowed in Python 3.15.

API documentation generators[edit]

Tools that can generate documentation for Python API include pydoc (available as part of the standard library), Sphinx, Pdoc and its forks, Doxygen and Graphviz, among others.[188]

Naming[edit]

Python's name is derived from the British comedy group Monty Python, whom Python creator Guido van Rossum enjoyed while developing the language. Monty Python references appear frequently in Python code and culture;[189] for example, the metasyntactic variables often used in Python literature are spam and eggs instead of the traditional foo and bar.[189][190] The official Python documentation also contains various references to Monty Python routines.[191][192] Users of Python are sometimes referred to as "Pythonistas".[193]

The prefix Py- is used to show that something is related to Python. Examples of the use of this prefix in names of Python applications or libraries include Pygame, a binding of SDL to Python (commonly used to create games); PyQt and PyGTK, which bind Qt and GTK to Python respectively; and PyPy, a Python implementation originally written in Python.

Popularity[edit]

Since 2003, Python has consistently ranked in the top ten most popular programming languages in the TIOBE Programming Community Index where as of December 2022 it was the most popular language (ahead of C, C++, and Java).[40] It was selected as Programming Language of the Year (for "the highest rise in ratings in a year") in 2007, 2010, 2018, and 2020 (the only language to have done so four times as of 2020[194]).

Large organizations that use Python include Wikipedia, Google,[195] Yahoo!,[196] CERN,[197] NASA,[198] Facebook,[199] Amazon, Instagram,[200] Spotify,[201] and some smaller entities like ILM[202] and ITA.[203] The social news networking site Reddit was written mostly in Python.[204]

Uses[edit]

Python Powered

Python can serve as a scripting language for web applications, e.g. via mod_wsgi for the Apache webserver.[205] With Web Server Gateway Interface, a standard API has evolved to facilitate these applications. Web frameworks like Django, Pylons, Pyramid, TurboGears, web2py, Tornado, Flask, Bottle, and Zope support developers in the design and maintenance of complex applications. Pyjs and IronPython can be used to develop the client-side of Ajax-based applications. SQLAlchemy can be used as a data mapper to a relational database. Twisted is a framework to program communications between computers, and is used (for example) by Dropbox.

Libraries such as NumPy, SciPy and Matplotlib allow the effective use of Python in scientific computing,[206][207] with specialized libraries such as Biopython and Astropy providing domain-specific functionality. SageMath is a computer algebra system with a notebook interface programmable in Python: its library covers many aspects of mathematics, including algebra, combinatorics, numerical mathematics, number theory, and calculus.[208] OpenCV has Python bindings with a rich set of features for computer vision and image processing.[209]

Python is commonly used in artificial intelligence projects and machine learning projects with the help of libraries like TensorFlow, Keras, Pytorch, scikit-learn and the Logic language ProbLog.[210][211][212][213][214] As a scripting language with a modular architecture, simple syntax, and rich text processing tools, Python is often used for natural language processing.[215]

The combination of Python and Prolog has proved to be particularly useful for AI applications, with Prolog providing knowledge representation and reasoning capablities. The Janus system, in particular, exploits the similarites between these two languages, in part because of their use of dynamic typing, and the simple recursive nature of their data structures. Typical applications of this combination include natural language processing, visual query answering, geospatial reasoning, and handling of semantic web data.[216][217] The Natlog system, implemented in Python, uses Definite Clause Grammars (DCGs) as prompt generators for text-to-text generators like GPT3 and text-to-image generators like DALL-E or Stable Diffusion.[218]

Python can also be used for graphical user interface (GUI) by using libraries like Tkinter.[219][220]

Python has been successfully embedded in many software products as a scripting language, including in finite element method software such as Abaqus, 3D parametric modelers like FreeCAD, 3D animation packages such as 3ds Max, Blender, Cinema 4D, Lightwave, Houdini, Maya, modo, MotionBuilder, Softimage, the visual effects compositor Nuke, 2D imaging programs like GIMP,[221] Inkscape, Scribus and Paint Shop Pro,[222] and musical notation programs like scorewriter and capella. GNU Debugger uses Python as a pretty printer to show complex structures such as C++ containers. Esri promotes Python as the best choice for writing scripts in ArcGIS.[223] It has also been used in several video games,[224][225] and has been adopted as first of the three available programming languages in Google App Engine, the other two being Java and Go.[226]

Many operating systems include Python as a standard component. It ships with most Linux distributions,[227] AmigaOS 4 (using Python 2.7), FreeBSD (as a package), NetBSD, and OpenBSD (as a package) and can be used from the command line (terminal). Many Linux distributions use installers written in Python: Ubuntu uses the Ubiquity installer, while Red Hat Linux and Fedora Linux use the Anaconda installer. Gentoo Linux uses Python in its package management system, Portage.

Python is used extensively in the information security industry, including in exploit development.[228][229]

Most of the Sugar software for the One Laptop per Child XO, developed at Sugar Labs as of 2008, is written in Python.[230] The Raspberry Pi single-board computer project has adopted Python as its main user-programming language.

LibreOffice includes Python and intends to replace Java with Python. Its Python Scripting Provider is a core feature[231] since Version 4.0 from 7 February 2013.

Languages influenced by Python[edit]

Python's design and philosophy have influenced many other programming languages:

  • Boo uses indentation, a similar syntax, and a similar object model.[232]
  • Cobra uses indentation and a similar syntax, and its Acknowledgements document lists Python first among languages that influenced it.[233]
  • CoffeeScript, a programming language that cross-compiles to JavaScript, has Python-inspired syntax.
  • ECMAScriptJavaScript borrowed iterators and generators from Python.[234]
  • GDScript, a scripting language very similar to Python, built-in to the Godot game engine.[235]
  • Go is designed for the "speed of working in a dynamic language like Python"[236] and shares the same syntax for slicing arrays.
  • Groovy was motivated by the desire to bring the Python design philosophy to Java.[237]
  • Julia was designed to be "as usable for general programming as Python".[28]
  • Mojo is a non-strict[29][238] superset of Python (e.g. still missing classes, and adding e.g. struct).[239]
  • Nim uses indentation and similar syntax.[240]
  • Ruby's creator, Yukihiro Matsumoto, has said: "I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python. That's why I decided to design my own language."[241]
  • Swift, a programming language developed by Apple, has some Python-inspired syntax.[242]
  • Kotlin blends Python and Java features, minimizing boilerplate code for enhanced developer efficiency.[243]

Python's development practices have also been emulated by other languages. For example, the practice of requiring a document describing the rationale for, and issues surrounding, a change to the language (in Python, a PEP) is also used in Tcl,[244] Erlang,[245] and Swift.[246]

See also[edit]

References[edit]

  1. ^ "General Python FAQ – Python 3.9.2 documentation". docs.python.org. Archived from the original on 24 October 2012. Retrieved 28 March 2021.
  2. ^ "Python 0.9.1 part 01/21". alt.sources archives. Archived from the original on 11 August 2021. Retrieved 11 August 2021.
  3. ^ "Why is Python a dynamic language and also a strongly typed language". Python Wiki. Archived from the original on 14 March 2021. Retrieved 27 January 2021.
  4. ^ a b "PEP 483 – The Theory of Type Hints". Python.org. Archived from the original on 14 June 2020. Retrieved 14 June 2018.
  5. ^ "PEP 11 – CPython platform support | peps.python.org". Python Enhancement Proposals (PEPs). Retrieved 22 April 2024.
  6. ^ "PEP 738 – Adding Android as a supported platform | peps.python.org". Python Enhancement Proposals (PEPs). Retrieved 19 May 2024.
  7. ^ "Download Python for Other Platforms". Python.org. Archived from the original on 27 November 2020. Retrieved 18 August 2023.
  8. ^ "test – Regression tests package for Python – Python 3.7.13 documentation". docs.python.org. Archived from the original on 17 May 2022. Retrieved 17 May 2022.
  9. ^ "platform – Access to underlying platform's identifying data – Python 3.10.4 documentation". docs.python.org. Archived from the original on 17 May 2022. Retrieved 17 May 2022.
  10. ^ Holth, Moore (30 March 2014). "PEP 0441 – Improving Python ZIP Application Support". Archived from the original on 26 December 2018. Retrieved 12 November 2015.
  11. ^ "Starlark Language". Archived from the original on 15 June 2020. Retrieved 25 May 2019.
  12. ^ a b "Why was Python created in the first place?". General Python FAQ. Python Software Foundation. Archived from the original on 24 October 2012. Retrieved 22 March 2007. I had extensive experience with implementing an interpreted language in the ABC group at CWI, and from working with this group I had learned a lot about language design. This is the origin of many Python features, including the use of indentation for statement grouping and the inclusion of very high-level data types (although the details are all different in Python).
  13. ^ "Ada 83 Reference Manual (raise statement)". Archived from the original on 22 October 2019. Retrieved 7 January 2020.
  14. ^ a b Kuchling, Andrew M. (22 December 2006). "Interview with Guido van Rossum (July 1998)". amk.ca. Archived from the original on 1 May 2007. Retrieved 12 March 2012. I'd spent a summer at DEC's Systems Research Center, which introduced me to Modula-2+; the Modula-3 final report was being written there at about the same time. What I learned there later showed up in Python's exception handling, modules, and the fact that methods explicitly contain 'self' in their parameter list. String slicing came from Algol-68 and Icon.
  15. ^ a b c "itertools – Functions creating iterators for efficient looping – Python 3.7.1 documentation". docs.python.org. Archived from the original on 14 June 2020. Retrieved 22 November 2016. This module implements a number of iterator building blocks inspired by constructs from APL, Haskell, and SML.
  16. ^ van Rossum, Guido (1993). "An Introduction to Python for UNIX/C Programmers". Proceedings of the NLUUG Najaarsconferentie (Dutch UNIX Users Group). CiteSeerX 10.1.1.38.2023. even though the design of C is far from ideal, its influence on Python is considerable.
  17. ^ a b "Classes". The Python Tutorial. Python Software Foundation. Archived from the original on 23 October 2012. Retrieved 20 February 2012. It is a mixture of the class mechanisms found in C++ and Modula-3
  18. ^ Lundh, Fredrik. "Call By Object". effbot.org. Archived from the original on 23 November 2019. Retrieved 21 November 2017. 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.
  19. ^ Simionato, Michele. "The Python 2.3 Method Resolution Order". Python Software Foundation. Archived from the original on 20 August 2020. Retrieved 29 July 2014. 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
  20. ^ Kuchling, A. M. "Functional Programming HOWTO". Python v2.7.2 documentation. Python Software Foundation. Archived from the original on 24 October 2012. Retrieved 9 February 2012. List comprehensions and generator expressions [...] are a concise notation for such operations, borrowed from the functional programming language Haskell.
  21. ^ Schemenauer, Neil; Peters, Tim; Hetland, Magnus Lie (18 May 2001). "PEP 255 – Simple Generators". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 5 June 2020. Retrieved 9 February 2012.
  22. ^ "More Control Flow Tools". Python 3 documentation. Python Software Foundation. Archived from the original on 4 June 2016. Retrieved 24 July 2015. By popular demand, a few features commonly found in functional programming languages like Lisp have been added to Python. With the lambda keyword, small anonymous functions can be created.
  23. ^ "re – Regular expression operations – Python 3.10.6 documentation". docs.python.org. Archived from the original on 18 July 2018. Retrieved 6 September 2022. This module provides regular expression matching operations similar to those found in Perl.
  24. ^ "CoffeeScript". coffeescript.org. Archived from the original on 12 June 2020. Retrieved 3 July 2018.
  25. ^ "The Genie Programming Language Tutorial". Archived from the original on 1 June 2020. Retrieved 28 February 2020.
  26. ^ "Perl and Python influences in JavaScript". www.2ality.com. 24 February 2013. Archived from the original on 26 December 2018. Retrieved 15 May 2015.
  27. ^ Rauschmayer, Axel. "Chapter 3: The Nature of JavaScript; Influences". O'Reilly, Speaking JavaScript. Archived from the original on 26 December 2018. Retrieved 15 May 2015.
  28. ^ a b "Why We Created Julia". Julia website. February 2012. Archived from the original on 2 May 2020. Retrieved 5 June 2014. We want something as usable for general programming as Python [...]
  29. ^ a b Krill, Paul (4 May 2023). "Mojo language marries Python and MLIR for AI development". InfoWorld. Archived from the original on 5 May 2023. Retrieved 5 May 2023.
  30. ^ Ring Team (4 December 2017). "Ring and other languages". ring-lang.net. ring-lang. Archived from the original on 25 December 2018. Retrieved 4 December 2017.
  31. ^ Bini, Ola (2007). Practical JRuby on Rails Web 2.0 Projects: bringing Ruby on Rails to the Java platform. Berkeley: APress. p. 3. ISBN 978-1-59059-881-8.
  32. ^ Lattner, Chris (3 June 2014). "Chris Lattner's Homepage". Chris Lattner. Archived from the original on 25 December 2018. Retrieved 3 June 2014. The Swift language is the product of tireless effort from a team of language experts, documentation gurus, compiler optimization ninjas, and an incredibly important internal dogfooding group who provided feedback to help refine and battle-test ideas. 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.
  33. ^ Kuhlman, Dave. "A Python Book: Beginning Python, Advanced Python, and Python Exercises". Section 1.1. Archived from the original (PDF) on 23 June 2012.
  34. ^ "About Python". Python Software Foundation. Archived from the original on 20 April 2012. Retrieved 24 April 2012., second section "Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files."
  35. ^ "PEP 206 – Python Advanced Library". Python.org. Archived from the original on 5 May 2021. Retrieved 11 October 2021.
  36. ^ Rossum, Guido Van (20 January 2009). "The History of Python: A Brief Timeline of Python". The History of Python. Archived from the original on 5 June 2020. Retrieved 5 March 2021.
  37. ^ Peterson, Benjamin (20 April 2020). "Python 2.7.18, the last release of Python 2". Python Insider. Archived from the original on 26 April 2020. Retrieved 27 April 2020.
  38. ^ "Stack Overflow Developer Survey 2022". Stack Overflow. Archived from the original on 27 June 2022. Retrieved 12 August 2022.
  39. ^ "The State of Developer Ecosystem in 2020 Infographic". JetBrains: Developer Tools for Professionals and Teams. Archived from the original on 1 March 2021. Retrieved 5 March 2021.
  40. ^ a b "TIOBE Index". TIOBE. Archived from the original on 25 February 2018. Retrieved 3 January 2023. The TIOBE Programming Community index is an indicator of the popularity of programming languages Updated as required.
  41. ^ "PYPL PopularitY of Programming Language index". pypl.github.io. Archived from the original on 14 March 2017. Retrieved 26 March 2021.
  42. ^ a b Venners, Bill (13 January 2003). "The Making of Python". Artima Developer. Artima. Archived from the original on 1 September 2016. Retrieved 22 March 2007.
  43. ^ van Rossum, Guido (29 August 2000). "SETL (was: Lukewarm about range literals)". Python-Dev (Mailing list). Archived from the original on 14 July 2018. Retrieved 13 March 2011.
  44. ^ van Rossum, Guido (20 January 2009). "A Brief Timeline of Python". The History of Python. Archived from the original on 5 June 2020. Retrieved 20 January 2009.
  45. ^ Fairchild, Carlie (12 July 2018). "Guido van Rossum Stepping Down from Role as Python's Benevolent Dictator For Life". Linux Journal. Archived from the original on 13 July 2018. Retrieved 13 July 2018.
  46. ^ "PEP 8100". Python Software Foundation. Archived from the original on 4 June 2020. Retrieved 4 May 2019.
  47. ^ "PEP 13 – Python Language Governance". Python.org. Archived from the original on 27 May 2021. Retrieved 25 August 2021.
  48. ^ Kuchling, A. M.; Zadka, Moshe (16 October 2000). "What's New in Python 2.0". Python Software Foundation. Archived from the original on 23 October 2012. Retrieved 11 February 2012.
  49. ^ van Rossum, Guido (5 April 2006). "PEP 3000 – Python 3000". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 3 March 2016. Retrieved 27 June 2009.
  50. ^ "2to3 – Automated Python 2 to 3 code translation". docs.python.org. Archived from the original on 4 June 2020. Retrieved 2 February 2021.
  51. ^ "PEP 373 – Python 2.7 Release Schedule". python.org. Archived from the original on 19 May 2020. Retrieved 9 January 2017.
  52. ^ "PEP 466 – Network Security Enhancements for Python 2.7.x". python.org. Archived from the original on 4 June 2020. Retrieved 9 January 2017.
  53. ^ "Sunsetting Python 2". Python.org. Archived from the original on 12 January 2020. Retrieved 22 September 2019.
  54. ^ "PEP 373 – Python 2.7 Release Schedule". Python.org. Archived from the original on 13 January 2020. Retrieved 22 September 2019.
  55. ^ "Python Release Python 3.7.17". Python.org. Archived from the original on 31 July 2023. Retrieved 18 August 2023.
  56. ^ mattip (25 December 2023). "PyPy v7.3.14 release". PyPy. Archived from the original on 5 January 2024. Retrieved 5 January 2024.
  57. ^ "CVE-2021-3177". Red Hat Customer Portal. Archived from the original on 6 March 2021. Retrieved 26 February 2021.
  58. ^ "CVE-2021-3177". CVE. Archived from the original on 27 February 2021. Retrieved 26 February 2021.
  59. ^ "CVE-2021-23336". CVE. Archived from the original on 24 February 2021. Retrieved 26 February 2021.
  60. ^ Langa, Łukasz (24 March 2022). "Python 3.10.4 and 3.9.12 are now available out of schedule". Python Insider. Archived from the original on 21 April 2022. Retrieved 19 April 2022.
  61. ^ Langa, Łukasz (16 March 2022). "Python 3.10.3, 3.9.11, 3.8.13, and 3.7.13 are now available with security content". Python Insider. Archived from the original on 17 April 2022. Retrieved 19 April 2022.
  62. ^ Langa, Łukasz (17 May 2022). "Python 3.9.13 is now available". Python Insider. Archived from the original on 17 May 2022. Retrieved 21 May 2022.
  63. ^ Langa, Łukasz (7 September 2022). "Python releases 3.10.7, 3.9.14, 3.8.14, and 3.7.14 are now available". Python Insider. Archived from the original on 13 September 2022. Retrieved 16 September 2022.
  64. ^ "CVE-2020-10735". CVE. Archived from the original on 20 September 2022. Retrieved 16 September 2022.
  65. ^ corbet (24 October 2022). "Python 3.11 released [LWN.net]". lwn.net. Retrieved 15 November 2022.
  66. ^ "Python". endoflife.date. 10 August 2023. Archived from the original on 18 September 2021. Retrieved 15 August 2023.
  67. ^ "What's New In Python 3.13". Python documentation. Retrieved 30 April 2024.
  68. ^ Wouters, Thomas (9 April 2024). "Python Insider: Python 3.12.3 and 3.13.0a6 released". Python Insider. Retrieved 29 April 2024.
  69. ^ The Cain Gang Ltd. "Python Metaclasses: Who? Why? When?" (PDF). Archived from the original (PDF) on 30 May 2009. Retrieved 27 June 2009.
  70. ^ "3.3. Special method names". The Python Language Reference. Python Software Foundation. Archived from the original on 15 December 2018. Retrieved 27 June 2009.
  71. ^ "PyDBC: method preconditions, method postconditions and class invariants for Python". Archived from the original on 23 November 2019. Retrieved 24 September 2011.
  72. ^ "Contracts for Python". Archived from the original on 15 June 2020. Retrieved 24 September 2011.
  73. ^ "PyDatalog". Archived from the original on 13 June 2020. Retrieved 22 July 2012.
  74. ^ "Extending and Embedding the Python Interpreter: Reference Counts". Docs.python.org. Archived from the original on 18 October 2012. Retrieved 5 June 2020. Since Python makes heavy use of malloc() and free(), it needs a strategy to avoid memory leaks as well as the use of freed memory. The chosen method is called reference counting.
  75. ^ a b Hettinger, Raymond (30 January 2002). "PEP 289 – Generator Expressions". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 14 June 2020. Retrieved 19 February 2012.
  76. ^ "6.5 itertools – Functions creating iterators for efficient looping". Docs.python.org. Archived from the original on 14 June 2020. Retrieved 22 November 2016.
  77. ^ a b Peters, Tim (19 August 2004). "PEP 20 – The Zen of Python". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 26 December 2018. Retrieved 24 November 2008.
  78. ^ Lutz, Mark (January 2022). "Python Changes 2014+". Learning Python. Archived from the original on 15 March 2024. Retrieved 25 February 2024.
  79. ^ Thomas, Robin (3 May 2023). "Python is not a great programming language". GitHub Gist. Archived from the original on 31 December 2023. Retrieved 25 February 2024.
  80. ^ "Confusion regarding a rule in The Zen of Python". Python Help - Discussions on Python.org. 3 May 2022. Archived from the original on 25 February 2024. Retrieved 25 February 2024.
  81. ^ Ambi, Chetan (4 July 2021). "The Most Controversial Python Walrus Operator". Python Simplified. Archived from the original on 27 August 2023. Retrieved 5 February 2024.
  82. ^ Grifski, Jeremy (24 May 2020). "The Controversy Behind The Walrus Operator in Python". The Renegade Coder. Archived from the original on 28 December 2023. Retrieved 25 February 2024.
  83. ^ Bader, Dan. "Python String Formatting Best Practices". Real Python. Archived from the original on 18 February 2024. Retrieved 25 February 2024.
  84. ^ Martelli, Alex; Ravenscroft, Anna; Ascher, David (2005). Python Cookbook, 2nd Edition. O'Reilly Media. p. 230. ISBN 978-0-596-00797-3. Archived from the original on 23 February 2020. Retrieved 14 November 2015.
  85. ^ "Python Culture". ebeab. 21 January 2014. Archived from the original on 30 January 2014.
  86. ^ a b "Transpiling Python to Julia using PyJL" (PDF). Archived (PDF) from the original on 19 November 2023. Retrieved 20 September 2023. After manually modifying one line of code by specifying the necessary type information, we obtained a speedup of 52.6×, making the translated Julia code 19.5× faster than the original Python code.
  87. ^ "Why is it called Python?". General Python FAQ. Docs.python.org. Archived from the original on 24 October 2012. Retrieved 3 January 2023.
  88. ^ "15 Ways Python Is a Powerful Force on the Web". Archived from the original on 11 May 2019. Retrieved 3 July 2018.
  89. ^ "pprint – Data pretty printer – Python 3.11.0 documentation". docs.python.org. Archived from the original on 22 January 2021. Retrieved 5 November 2022. stuff=['spam', 'eggs', 'lumberjack', 'knights', 'ni']
  90. ^ Clark, Robert (26 April 2019). "How to be Pythonic and why you should care". Medium. Archived from the original on 13 August 2021. Retrieved 20 January 2021.
  91. ^ "Code Style – The Hitchhiker's Guide to Python". docs.python-guide.org. Archived from the original on 27 January 2021. Retrieved 20 January 2021.
  92. ^ "Is Python a good language for beginning programmers?". General Python FAQ. Python Software Foundation. Archived from the original on 24 October 2012. Retrieved 21 March 2007.
  93. ^ "Myths about indentation in Python". Secnetix.de. Archived from the original on 18 February 2018. Retrieved 19 April 2011.
  94. ^ Guttag, John V. (12 August 2016). Introduction to Computation and Programming Using Python: With Application to Understanding Data. MIT Press. ISBN 978-0-262-52962-4.
  95. ^ "PEP 8 – Style Guide for Python Code". Python.org. Archived from the original on 17 April 2019. Retrieved 26 March 2019.
  96. ^ "8. Errors and Exceptions – Python 3.12.0a0 documentation". docs.python.org. Archived from the original on 9 May 2022. Retrieved 9 May 2022.
  97. ^ "Highlights: Python 2.5". Python.org. Archived from the original on 4 August 2019. Retrieved 20 March 2018.
  98. ^ van Rossum, Guido (22 April 2009). "Tail Recursion Elimination". Neopythonic.blogspot.be. Archived from the original on 19 May 2018. Retrieved 3 December 2012.
  99. ^ van Rossum, Guido (9 February 2006). "Language Design Is Not Just Solving Puzzles". Artima forums. Artima. Archived from the original on 17 January 2020. Retrieved 21 March 2007.
  100. ^ van Rossum, Guido; Eby, Phillip J. (10 May 2005). "PEP 342 – Coroutines via Enhanced Generators". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 29 May 2020. Retrieved 19 February 2012.
  101. ^ "PEP 380". Python.org. Archived from the original on 4 June 2020. Retrieved 3 December 2012.
  102. ^ "division". python.org. Archived from the original on 20 July 2006. Retrieved 30 July 2014.
  103. ^ "PEP 0465 – A dedicated infix operator for matrix multiplication". python.org. Archived from the original on 4 June 2020. Retrieved 1 January 2016.
  104. ^ "Python 3.5.1 Release and Changelog". python.org. Archived from the original on 14 May 2020. Retrieved 1 January 2016.
  105. ^ "What's New in Python 3.8". Archived from the original on 8 June 2020. Retrieved 14 October 2019.
  106. ^ van Rossum, Guido; Hettinger, Raymond (7 February 2003). "PEP 308 – Conditional Expressions". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 13 March 2016. Retrieved 13 July 2011.
  107. ^ "4. Built-in Types – Python 3.6.3rc1 documentation". python.org. Archived from the original on 14 June 2020. Retrieved 1 October 2017.
  108. ^ "5.3. Tuples and Sequences – Python 3.7.1rc2 documentation". python.org. Archived from the original on 10 June 2020. Retrieved 17 October 2018.
  109. ^ a b "PEP 498 – Literal String Interpolation". python.org. Archived from the original on 15 June 2020. Retrieved 8 March 2017.
  110. ^ "Why must 'self' be used explicitly in method definitions and calls?". Design and History FAQ. Python Software Foundation. Archived from the original on 24 October 2012. Retrieved 19 February 2012.
  111. ^ Sweigart, Al (2020). Beyond the Basic Stuff with Python: Best Practices for Writing Clean Code. No Starch Press. p. 322. ISBN 978-1-59327-966-0. Archived from the original on 13 August 2021. Retrieved 7 July 2021.
  112. ^ "The Python Language Reference, section 3.3. New-style and classic classes, for release 2.7.1". Archived from the original on 26 October 2012. Retrieved 12 January 2011.
  113. ^ "PEP 484 – Type Hints | peps.python.org". peps.python.org. Archived from the original on 27 November 2023. Retrieved 29 November 2023.
  114. ^ "typing — Support for type hints". Python documentation. Python Software Foundation. Archived from the original on 21 February 2020. Retrieved 22 December 2023.
  115. ^ "mypy – Optional Static Typing for Python". Archived from the original on 6 June 2020. Retrieved 28 January 2017.
  116. ^ "Introduction". mypyc.readthedocs.io. Archived from the original on 22 December 2023. Retrieved 22 December 2023.
  117. ^ "15. Floating Point Arithmetic: Issues and Limitations – Python 3.8.3 documentation". docs.python.org. Archived from the original on 6 June 2020. Retrieved 6 June 2020. Almost all machines today (November 2000) use IEEE-754 floating point arithmetic, and almost all platforms map Python floats to IEEE-754 "double precision".
  118. ^ Zadka, Moshe; van Rossum, Guido (11 March 2001). "PEP 237 – Unifying Long Integers and Integers". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 28 May 2020. Retrieved 24 September 2011.
  119. ^ "Built-in Types". Archived from the original on 14 June 2020. Retrieved 3 October 2019.
  120. ^ "PEP 465 – A dedicated infix operator for matrix multiplication". python.org. Archived from the original on 29 May 2020. Retrieved 3 July 2018.
  121. ^ a b Zadka, Moshe; van Rossum, Guido (11 March 2001). "PEP 238 – Changing the Division Operator". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 28 May 2020. Retrieved 23 October 2013.
  122. ^ "Why Python's Integer Division Floors". 24 August 2010. Archived from the original on 5 June 2020. Retrieved 25 August 2010.
  123. ^ "round", The Python standard library, release 3.2, §2: Built-in functions, archived from the original on 25 October 2012, retrieved 14 August 2011
  124. ^ "round", The Python standard library, release 2.7, §2: Built-in functions, archived from the original on 27 October 2012, retrieved 14 August 2011
  125. ^ Beazley, David M. (2009). Python Essential Reference (4th ed.). Addison-Wesley Professional. p. 66. ISBN 9780672329784.
  126. ^ Kernighan, Brian W.; Ritchie, Dennis M. (1988). The C Programming Language (2nd ed.). p. 206.
  127. ^ a b Batista, Facundo (17 October 2003). "PEP 327 – Decimal Data Type". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 4 June 2020. Retrieved 24 November 2008.
  128. ^ "What's New in Python 2.6". Python v2.6.9 documentation. 29 October 2013. Archived from the original on 23 December 2019. Retrieved 26 September 2015.
  129. ^ "10 Reasons Python Rocks for Research (And a Few Reasons it Doesn't) – Hoyt Koepke". University of Washington Department of Statistics. Archived from the original on 31 May 2020. Retrieved 3 February 2019.
  130. ^ Shell, Scott (17 June 2014). "An introduction to Python for scientific computing" (PDF). Archived (PDF) from the original on 4 February 2019. Retrieved 3 February 2019.
  131. ^ Piotrowski, Przemyslaw (July 2006). "Build a Rapid Web Development Environment for Python Server Pages and Oracle". Oracle Technology Network. Oracle. Archived from the original on 2 April 2019. Retrieved 12 March 2012.
  132. ^ Eby, Phillip J. (7 December 2003). "PEP 333 – Python Web Server Gateway Interface v1.0". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 14 June 2020. Retrieved 19 February 2012.
  133. ^ "PyPI". PyPI. 17 March 2024. Archived from the original on 17 March 2024.
  134. ^ Enthought, Canopy. "Canopy". www.enthought.com. Archived from the original on 15 July 2017. Retrieved 20 August 2016.
  135. ^ "PEP 7 – Style Guide for C Code | peps.python.org". peps.python.org. Archived from the original on 24 April 2022. Retrieved 28 April 2022.
  136. ^ "4. Building C and C++ Extensions – Python 3.9.2 documentation". docs.python.org. Archived from the original on 3 March 2021. Retrieved 1 March 2021.
  137. ^ van Rossum, Guido (5 June 2001). "PEP 7 – Style Guide for C Code". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 1 June 2020. Retrieved 24 November 2008.
  138. ^ "CPython byte code". Docs.python.org. Archived from the original on 5 June 2020. Retrieved 16 February 2016.
  139. ^ "Python 2.5 internals" (PDF). Archived (PDF) from the original on 6 August 2012. Retrieved 19 April 2011.
  140. ^ "Changelog – Python 3.9.0 documentation". docs.python.org. Archived from the original on 7 February 2021. Retrieved 8 February 2021.
  141. ^ "Download Python". Python.org. Archived from the original on 8 December 2020. Retrieved 13 December 2020.
  142. ^ "history [vmspython]". www.vmspython.org. Archived from the original on 2 December 2020. Retrieved 4 December 2020.
  143. ^ "An Interview with Guido van Rossum". Oreilly.com. Archived from the original on 16 July 2014. Retrieved 24 November 2008.
  144. ^ "Download Python for Other Platforms". Python.org. Archived from the original on 27 November 2020. Retrieved 4 December 2020.
  145. ^ "PyPy compatibility". Pypy.org. Archived from the original on 6 June 2020. Retrieved 3 December 2012.
  146. ^ Team, The PyPy (28 December 2019). "Download and Install". PyPy. Archived from the original on 8 January 2022. Retrieved 8 January 2022.
  147. ^ "speed comparison between CPython and Pypy". Speed.pypy.org. Archived from the original on 10 May 2021. Retrieved 3 December 2012.
  148. ^ "Application-level Stackless features – PyPy 2.0.2 documentation". Doc.pypy.org. Archived from the original on 4 June 2020. Retrieved 17 July 2013.
  149. ^ "Python-for-EV3". LEGO Education. Archived from the original on 7 June 2020. Retrieved 17 April 2019.
  150. ^ Yegulalp, Serdar (29 October 2020). "Pyston returns from the dead to speed Python". InfoWorld. Archived from the original on 27 January 2021. Retrieved 26 January 2021.
  151. ^ "cinder: Instagram's performance-oriented fork of CPython". GitHub. Archived from the original on 4 May 2021. Retrieved 4 May 2021.
  152. ^ Aroca, Rafael (7 August 2021). "Snek Lang: feels like Python on Arduinos". Yet Another Technology Blog. Archived from the original on 5 January 2024. Retrieved 4 January 2024.
  153. ^ Aufranc (CNXSoft), Jean-Luc (16 January 2020). "Snekboard Controls LEGO Power Functions with CircuitPython or Snek Programming Languages (Crowdfunding) - CNX Software". CNX Software - Embedded Systems News. Archived from the original on 5 January 2024. Retrieved 4 January 2024.
  154. ^ Kennedy (@mkennedy), Michael. "Ready to find out if you're git famous?". pythonbytes.fm. Archived from the original on 5 January 2024. Retrieved 4 January 2024.
  155. ^ Packard, Keith (20 December 2022). "The Snek Programming Language: A Python-inspired Embedded Computing Language" (PDF). Archived (PDF) from the original on 4 January 2024. Retrieved 4 January 2024.
  156. ^ "Plans for optimizing Python". Google Project Hosting. 15 December 2009. Archived from the original on 11 April 2016. Retrieved 24 September 2011.
  157. ^ "Python on the Nokia N900". Stochastic Geometry. 29 April 2010. Archived from the original on 20 June 2019. Retrieved 9 July 2015.
  158. ^ "Brython". brython.info. Archived from the original on 3 August 2018. Retrieved 21 January 2021.
  159. ^ "Transcrypt – Python in the browser". transcrypt.org. Archived from the original on 19 August 2018. Retrieved 22 December 2020.
  160. ^ "Transcrypt: Anatomy of a Python to JavaScript Compiler". InfoQ. Archived from the original on 5 December 2020. Retrieved 20 January 2021.
  161. ^ "Codon: Differences with Python". Archived from the original on 25 May 2023. Retrieved 28 August 2023.
  162. ^ Lawson, Loraine (14 March 2023). "MIT-Created Compiler Speeds up Python Code". The New Stack. Archived from the original on 6 April 2023. Retrieved 28 August 2023.
  163. ^ "Nuitka Home | Nuitka Home". nuitka.net. Archived from the original on 30 May 2020. Retrieved 18 August 2017.
  164. ^ Guelton, Serge; Brunet, Pierrick; Amini, Mehdi; Merlini, Adrien; Corbillon, Xavier; Raynaud, Alan (16 March 2015). "Pythran: enabling static optimization of scientific Python programs". Computational Science & Discovery. 8 (1). IOP Publishing: 014001. Bibcode:2015CS&D....8a4001G. doi:10.1088/1749-4680/8/1/014001. ISSN 1749-4699.
  165. ^ "The Python → 11l → C++ transpiler". Archived from the original on 24 September 2022. Retrieved 17 July 2022.
  166. ^ "google/grumpy". 10 April 2020. Archived from the original on 15 April 2020. Retrieved 25 March 2020 – via GitHub.
  167. ^ "Projects". opensource.google. Archived from the original on 24 April 2020. Retrieved 25 March 2020.
  168. ^ Francisco, Thomas Claburn in San. "Google's Grumpy code makes Python Go". www.theregister.com. Archived from the original on 7 March 2021. Retrieved 20 January 2021.
  169. ^ "GitHub – IronLanguages/ironpython3: Implementation of Python 3.x for .NET Framework that is built on top of the Dynamic Language Runtime". GitHub. Archived from the original on 28 September 2021.
  170. ^ "IronPython.net /". ironpython.net. Archived from the original on 17 April 2021.
  171. ^ "Jython FAQ". www.jython.org. Archived from the original on 22 April 2021. Retrieved 22 April 2021.
  172. ^ Murri, Riccardo (2013). Performance of Python runtimes on a non-numeric scientific code. European Conference on Python in Science (EuroSciPy). arXiv:1404.6388. Bibcode:2014arXiv1404.6388M.
  173. ^ "The Computer Language Benchmarks Game". Archived from the original on 14 June 2020. Retrieved 30 April 2020.
  174. ^ a b Warsaw, Barry; Hylton, Jeremy; Goodger, David (13 June 2000). "PEP 1 – PEP Purpose and Guidelines". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 6 June 2020. Retrieved 19 April 2011.
  175. ^ "PEP 8 – Style Guide for Python Code". Python.org. Archived from the original on 17 April 2019. Retrieved 26 March 2019.
  176. ^ Cannon, Brett. "Guido, Some Guys, and a Mailing List: How Python is Developed". python.org. Python Software Foundation. Archived from the original on 1 June 2009. Retrieved 27 June 2009.
  177. ^ "Moving Python's bugs to GitHub [LWN.net]". Archived from the original on 2 October 2022. Retrieved 2 October 2022.
  178. ^ "Python Developer's Guide – Python Developer's Guide". devguide.python.org. Archived from the original on 9 November 2020. Retrieved 17 December 2019.
  179. ^ Hughes, Owen (24 May 2021). "Programming languages: Why Python 4.0 might never arrive, according to its creator". TechRepublic. Archived from the original on 14 July 2022. Retrieved 16 May 2022.
  180. ^ "PEP 602 – Annual Release Cycle for Python". Python.org. Archived from the original on 14 June 2020. Retrieved 6 November 2019.
  181. ^ "Changing the Python release cadence [LWN.net]". lwn.net. Archived from the original on 6 November 2019. Retrieved 6 November 2019.
  182. ^ Norwitz, Neal (8 April 2002). "[Python-Dev] Release Schedules (was Stability & change)". Archived from the original on 15 December 2018. Retrieved 27 June 2009.
  183. ^ a b Aahz; Baxter, Anthony (15 March 2001). "PEP 6 – Bug Fix Releases". Python Enhancement Proposals. Python Software Foundation. Archived from the original on 5 June 2020. Retrieved 27 June 2009.
  184. ^ "Python Buildbot". Python Developer's Guide. Python Software Foundation. Archived from the original on 5 June 2020. Retrieved 24 September 2011.
  185. ^ "1. Extending Python with C or C++ – Python 3.9.1 documentation". docs.python.org. Archived from the original on 23 June 2020. Retrieved 14 February 2021.
  186. ^ "PEP 623 – Remove wstr from Unicode". Python.org. Archived from the original on 5 March 2021. Retrieved 14 February 2021.
  187. ^ "PEP 634 – Structural Pattern Matching: Specification". Python.org. Archived from the original on 6 May 2021. Retrieved 14 February 2021.
  188. ^ "Documentation Tools". Python.org. Archived from the original on 11 November 2020. Retrieved 22 March 2021.
  189. ^ a b "Whetting Your Appetite". The Python Tutorial. Python Software Foundation. Archived from the original on 26 October 2012. Retrieved 20 February 2012.
  190. ^ "In Python, should I use else after a return in an if block?". Stack Overflow. Stack Exchange. 17 February 2011. Archived from the original on 20 June 2019. Retrieved 6 May 2011.
  191. ^ Lutz, Mark (2009). Learning Python: Powerful Object-Oriented Programming. O'Reilly Media, Inc. p. 17. ISBN 9781449379322. Archived from the original on 17 July 2017. Retrieved 9 May 2017.
  192. ^ Fehily, Chris (2002). Python. Peachpit Press. p. xv. ISBN 9780201748840. Archived from the original on 17 July 2017. Retrieved 9 May 2017.
  193. ^ Lubanovic, Bill (2014). Introducing Python. Sebastopol, CA : O'Reilly Media. p. 305. ISBN 978-1-4493-5936-2. Retrieved 31 July 2023.
  194. ^ Blake, Troy (18 January 2021). "TIOBE Index for January 2021". Technology News and Information by SeniorDBA. Archived from the original on 21 March 2021. Retrieved 26 February 2021.
  195. ^ "Quotes about Python". Python Software Foundation. Archived from the original on 3 June 2020. Retrieved 8 January 2012.
  196. ^ "Organizations Using Python". Python Software Foundation. Archived from the original on 21 August 2018. Retrieved 15 January 2009.
  197. ^ "Python : the holy grail of programming". CERN Bulletin (31/2006). CERN Publications. 31 July 2006. Archived from the original on 15 January 2013. Retrieved 11 February 2012.
  198. ^ Shafer, Daniel G. (17 January 2003). "Python Streamlines Space Shuttle Mission Design". Python Software Foundation. Archived from the original on 5 June 2020. Retrieved 24 November 2008.
  199. ^ "Tornado: Facebook's Real-Time Web Framework for Python – Facebook for Developers". Facebook for Developers. Archived from the original on 19 February 2019. Retrieved 19 June 2018.
  200. ^ "What Powers Instagram: Hundreds of Instances, Dozens of Technologies". Instagram Engineering. 11 December 2016. Archived from the original on 15 June 2020. Retrieved 27 May 2019.
  201. ^ "How we use Python at Spotify". Spotify Labs. 20 March 2013. Archived from the original on 10 June 2020. Retrieved 25 July 2018.
  202. ^ Fortenberry, Tim (17 January 2003). "Industrial Light & Magic Runs on Python". Python Software Foundation. Archived from the original on 6 June 2020. Retrieved 11 February 2012.
  203. ^ Taft, Darryl K. (5 March 2007). "Python Slithers into Systems". eWeek.com. Ziff Davis Holdings. Archived from the original on 13 August 2021. Retrieved 24 September 2011.
  204. ^ GitHub – reddit-archive/reddit: historical code from reddit.com., The Reddit Archives, archived from the original on 1 June 2020, retrieved 20 March 2019
  205. ^ "Usage statistics and market share of Python for websites". 2012. Archived from the original on 13 August 2021. Retrieved 18 December 2012.
  206. ^ Oliphant, Travis (2007). "Python for Scientific Computing". Computing in Science and Engineering. 9 (3): 10–20. Bibcode:2007CSE.....9c..10O. CiteSeerX 10.1.1.474.6460. doi:10.1109/MCSE.2007.58. S2CID 206457124. Archived from the original on 15 June 2020. Retrieved 10 April 2015.
  207. ^ Millman, K. Jarrod; Aivazis, Michael (2011). "Python for Scientists and Engineers". Computing in Science and Engineering. 13 (2): 9–12. Bibcode:2011CSE....13b...9M. doi:10.1109/MCSE.2011.36. Archived from the original on 19 February 2019. Retrieved 7 July 2014.
  208. ^ Science education with SageMath, Innovative Computing in Science Education, archived from the original on 15 June 2020, retrieved 22 April 2019
  209. ^ "OpenCV: OpenCV-Python Tutorials". docs.opencv.org. Archived from the original on 23 September 2020. Retrieved 14 September 2020.
  210. ^ Dean, Jeff; Monga, Rajat; et al. (9 November 2015). "TensorFlow: Large-scale machine learning on heterogeneous systems" (PDF). TensorFlow.org. Google Research. Archived (PDF) from the original on 20 November 2015. Retrieved 10 November 2015.
  211. ^ Piatetsky, Gregory. "Python eats away at R: Top Software for Analytics, Data Science, Machine Learning in 2018: Trends and Analysis". KDnuggets. Archived from the original on 15 November 2019. Retrieved 30 May 2018.
  212. ^ "Who is using scikit-learn? – scikit-learn 0.20.1 documentation". scikit-learn.org. Archived from the original on 6 May 2020. Retrieved 30 November 2018.
  213. ^ Jouppi, Norm. "Google supercharges machine learning tasks with TPU custom chip". Google Cloud Platform Blog. Archived from the original on 18 May 2016. Retrieved 19 May 2016.
  214. ^ De Raedt, Luc; Kimmig, Angelika (2015). "Probabilistic (logic) programming concepts". Machine Learning. 100 (1): 5–47. doi:10.1007/s10994-015-5494-z. S2CID 3166992.
  215. ^ "Natural Language Toolkit – NLTK 3.5b1 documentation". www.nltk.org. Archived from the original on 13 June 2020. Retrieved 10 April 2020.
  216. ^ Andersen, C. and Swift, T., 2023. The Janus System: a bridge to new prolog applications. In Prolog: The Next 50 Years (pp. 93-104). Cham: Springer Nature Switzerland.
  217. ^ "SWI-Prolog Python interface". Archived from the original on 15 March 2024. Retrieved 15 March 2024.
  218. ^ Tarau, P., 2023. Reflections on automation, learnability and expressiveness in logic-based programming languages. In Prolog: The Next 50 Years (pp. 359-371). Cham: Springer Nature Switzerland.
  219. ^ "Tkinter — Python interface to TCL/Tk". Archived from the original on 18 October 2012. Retrieved 9 June 2023.
  220. ^ "Python Tkinter Tutorial". 3 June 2020. Archived from the original on 9 June 2023. Retrieved 9 June 2023.
  221. ^ "Installers for GIMP for Windows – Frequently Asked Questions". 26 July 2013. Archived from the original on 17 July 2013. Retrieved 26 July 2013.
  222. ^ "jasc psp9components". Archived from the original on 19 March 2008.
  223. ^ "About getting started with writing geoprocessing scripts". ArcGIS Desktop Help 9.2. Environmental Systems Research Institute. 17 November 2006. Archived from the original on 5 June 2020. Retrieved 11 February 2012.
  224. ^ CCP porkbelly (24 August 2010). "Stackless Python 2.7". EVE Community Dev Blogs. CCP Games. Archived from the original on 11 January 2014. Retrieved 11 January 2014. As you may know, EVE has at its core the programming language known as Stackless Python.
  225. ^ Caudill, Barry (20 September 2005). "Modding Sid Meier's Civilization IV". Sid Meier's Civilization IV Developer Blog. Firaxis Games. Archived from the original on 2 December 2010. we created three levels of tools ... The next level offers Python and XML support, letting modders with more experience manipulate the game world and everything in it.
  226. ^ "Python Language Guide (v1.0)". Google Documents List Data API v1.0. Archived from the original on 15 July 2010.
  227. ^ "Python Setup and Usage". Python Software Foundation. Archived from the original on 17 June 2020. Retrieved 10 January 2020.
  228. ^ "Immunity: Knowing You're Secure". Archived from the original on 16 February 2009.
  229. ^ "Core Security". Core Security. Archived from the original on 9 June 2020. Retrieved 10 April 2020.
  230. ^ "What is Sugar?". Sugar Labs. Archived from the original on 9 January 2009. Retrieved 11 February 2012.
  231. ^ "4.0 New Features and Fixes". LibreOffice.org. The Document Foundation. 2013. Archived from the original on 9 February 2014. Retrieved 25 February 2013.
  232. ^ "Gotchas for Python Users". boo.codehaus.org. Codehaus Foundation. Archived from the original on 11 December 2008. Retrieved 24 November 2008.
  233. ^ Esterbrook, Charles. "Acknowledgements". cobra-language.com. Cobra Language. Archived from the original on 8 February 2008. Retrieved 7 April 2010.
  234. ^ "Proposals: iterators and generators [ES4 Wiki]". wiki.ecmascript.org. Archived from the original on 20 October 2007. Retrieved 24 November 2008.
  235. ^ "Frequently asked questions". Godot Engine documentation. Archived from the original on 28 April 2021. Retrieved 10 May 2021.
  236. ^ Kincaid, Jason (10 November 2009). "Google's Go: A New Programming Language That's Python Meets C++". TechCrunch. Archived from the original on 18 January 2010. Retrieved 29 January 2010.
  237. ^ Strachan, James (29 August 2003). "Groovy – the birth of a new dynamic language for the Java platform". Archived from the original on 5 April 2007. Retrieved 11 June 2007.
  238. ^ "Modular Docs - Why Mojo". docs.modular.com. Archived from the original on 5 May 2023. Retrieved 5 May 2023. Mojo as a member of the Python family [..] Embracing Python massively simplifies our design efforts, because most of the syntax is already specified. [..] we decided that the right long-term goal for Mojo is to provide a superset of Python (i.e. be compatible with existing programs) and to embrace the CPython immediately for long-tail ecosystem enablement. To a Python programmer, we expect and hope that Mojo will be immediately familiar, while also providing new tools for developing systems-level code that enable you to do things that Python falls back to C and C++ for.
  239. ^ Spencer, Michael (4 May 2023). "What is Mojo Programming Language?". datasciencelearningcenter.substack.com. Archived from the original on 5 May 2023. Retrieved 5 May 2023.
  240. ^ Yegulalp, Serdar (16 January 2017). "Nim language draws from best of Python, Rust, Go, and Lisp". InfoWorld. Archived from the original on 13 October 2018. Retrieved 7 June 2020. Nim's syntax is strongly reminiscent of Python's, as it uses indented code blocks and some of the same syntax (such as the way if/elif/then/else blocks are constructed).
  241. ^ "An Interview with the Creator of Ruby". Linuxdevcenter.com. Archived from the original on 28 April 2018. Retrieved 3 December 2012.
  242. ^ Lattner, Chris (3 June 2014). "Chris Lattner's Homepage". Chris Lattner. Archived from the original on 22 December 2015. Retrieved 3 June 2014. I started work on the Swift Programming Language in July of 2010. I implemented much of the basic language structure, with only a few people knowing of its existence. A few other (amazing) people started contributing in earnest late in 2011, and it became a major focus for the Apple Developer Tools group in July 2013 [...] drawing ideas from Objective-C, Rust, Haskell, Ruby, Python, C#, CLU, and far too many others to list.
  243. ^ Jalan, Nishant Aanjaney (10 November 2022). "Programming in Kotlin". CodeX. Retrieved 29 April 2024.
  244. ^ Kupries, Andreas; Fellows, Donal K. (14 September 2000). "TIP #3: TIP Format". tcl.tk. Tcl Developer Xchange. Archived from the original on 13 July 2017. Retrieved 24 November 2008.
  245. ^ Gustafsson, Per; Niskanen, Raimo (29 January 2007). "EEP 1: EEP Purpose and Guidelines". erlang.org. Archived from the original on 15 June 2020. Retrieved 19 April 2011.
  246. ^ "Swift Evolution Process". Swift Programming Language Evolution repository on GitHub. 18 February 2020. Archived from the original on 27 April 2020. Retrieved 27 April 2020.

Sources[edit]

Further reading[edit]

External links[edit]