Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Python (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== {{Main|History of Python}} [[File:Guido van Rossum in PyConUS24.jpg|thumb|311x311px|The designer of Python, [[Guido van Rossum]], at PyCon US 2024]] Python was conceived in the late 1980s<ref name="venners-interview-pt-1"/> by Guido van Rossum at [[Centrum Wiskunde & Informatica]] (CWI) in the [[Netherlands]]; it was conceived 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"/> Python implementation began in December, 1989.<ref name="timeline-of-python"/> Van Rossum assumed sole responsibility for the project, as the lead developer, until 12 July 2018, when he announced his "permanent vacation" from responsibilities as Python's "[[benevolent dictator for life]]" (BDFL); this title was bestowed on him by the Python community to reflect his long-term commitment as the project's chief decision-maker.<ref name="lj-bdfl-resignation"/> (He has since come out of retirement and is self-titled "BDFL-emeritus"<!-- on his Twitter-->.) In January, 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> The name ''Python'' is said to derive from the British comedy series [[Monty Python's Flying Circus]].<ref name=":0">{{Cite book |last1=Briggs |first1=Jason R. |title=Python for kids: a playful introduction to programming |last2=Lipovača |first2=Miran |date=2013 |publisher=No Starch Press |isbn=978-1-59327-407-8 |location=San Francisco, Calif}}</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 2.7's [[end-of-life product|end-of-life]] was initially set for 2015, and then postponed to 2020 out of concern that a large body of existing code could not easily be forward-ported to Python 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> It no longer receives security patches or updates.<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> While Python 2.7 and older versions are officially unsupported, a different unofficial Python implementation, [[PyPy]], continues to support Python 2, i.e., "2.7.18+" (plus 3.10), with the plus signifying (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> Python 3.0 was released on 3 December 2008, with some new semantics and changed syntax. At least every Python release since (the now unsupported) 3.5 has added some syntax to the language; a few later releases have removed outdated modules and have changed semantics, at least in a minor way. {{As of|2025|04|08|since=n}}, Python 3.13.3 is the latest stable release (it's highly recommended to upgrade to it, or upgrade any other older 3.x release). This version currently receives full bug-fix and security updates, while Python 3.12—released in October 2023—had active bug-fix support only until April 2025, and since then only security fixes. Python 3.9<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> is the oldest supported version of Python (albeit in the 'security support' phase), because Python 3.8 has become an end-of-life product.<ref>{{Cite web |title=Status of Python versions |url=https://devguide.python.org/versions/ |access-date=2024-10-07 |website=Python Developer's Guide |language=en}}</ref><ref>{{Cite web |date=8 October 2024 |title=Python |url=https://endoflife.date/python |access-date=2024-11-20 |website=endoflife.date |language=en-US }}</ref> Starting with Python 3.13, it and later versions receive two years of full support (which has increased from one and a half years), followed by three years of security support; this is the same total duration of support as previously. Security updates were expedited in 2021 and again twice in 2022. More issues were fixed in 2023 and in September 2024 (for Python versions 3.8.20 through 3.12.6)—all versions (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> had been insecure because of 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 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> --> <!-- 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 3.10 added the <code>|</code> union type operator<ref>{{cite web | url=https://docs.python.org/3/library/stdtypes.html#types-union | title=Built-in Types }}</ref> and added structural [[pattern matching]] capability to the language, with the new <code>match</code> and <code>case</code> keywords.<ref>{{Cite web |title=PEP 634 – Structural Pattern Matching: Specification |url=https://www.python.org/dev/peps/pep-0634/ |url-status=live |archive-url=https://web.archive.org/web/20210506005315/https://www.python.org/dev/peps/pep-0634/ |archive-date=6 May 2021 |access-date=2021-02-14 |website=Python.org |language=en}}</ref> Python 3.11 expanded [[exception handling (programming)|exception handling]] functionality. Python 3.12 added the new keyword <code>type</code>. Notable changes from version 3.10 to 3.11 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> Python 3.11 is claimed to be 10–60% faster than Python 3.10, and Python 3.12 increases by an additional 5%. Python 3.12 also includes improved error messages (again improved in 3.14) and many other changes. Python 3.13 introduced more syntax for types; a new and improved interactive interpreter ([[read–eval–print loop|REPL]]), featuring multi-line editing and color support; an incremental garbage collector, which results in shorter pauses for collection in programs that have many objects, as well as increasing the improved speed in 3.11 and 3.12); <!-- "A modified version of mimalloc is now included, optional but enabled by default if supported by the platform, and required for the free-threaded build mode." --> an ''experimental'' [[just-in-time compilation|just-in-time (JIT) compiler]] (such features need to be enabled specifically for the increase in speed);<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 an ''experimental'' free-threaded build mode, which disables the [[global interpreter lock]] (GIL), allowing threads to run more concurrently, as enabled in<code>python3.13t</code> or <code>python3.13t.exe</code>. Python Enhancement Proposal (PEP) 711 proposes PyBI—a standard format for distributing Python binaries.<!-- "Like wheels, but instead of a pre-built python package, it's a pre-built python interpreter" "A .pybi file is a zip file, that can be unpacked directly into an arbitrary location and then used as a self-contained Python environment. [..] The "arbitrary location" part is important: the pybi can't contain any hardcoded absolute paths. In particular, any preinstalled scripts MUST NOT embed absolute paths in their shebang lines."--><ref>{{Cite web |date=2023-04-07 |title=PEP 711: PyBI: a standard format for distributing Python Binaries |url=https://discuss.python.org/t/pep-711-pybi-a-standard-format-for-distributing-python-binaries/25547 |access-date=2024-11-20 |website=Discussions on Python.org |language=en}}</ref> Python 3.14.0 is now in the beta 1 phase (introduces e.g. a new opt-in interpreter, up to 30% faster). Python 3.15 will "Make UTF-8 mode default";<ref>{{Cite web |title=PEP 686 – Make UTF-8 mode default {{!}} peps.python.org |url=https://peps.python.org/pep-0686/ |access-date=2024-11-20 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref> This mode is supported in all current Python versions, but it currently must be opted into. [[UTF-8]] is already used by default on Windows (and other operating systems) for most purposes; an exception is opening files. Enabling UTF-8 also makes code fully cross-platform. ;Potentially breaking changes Python 3.0 introduced very breaking changes, but all breaking changes in 3.x discussed below, are designed to affect few users. 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 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 |url-status=live |archive-url=https://web.archive.org/web/20200623232830/https://docs.python.org/3/extending/extending.html |archive-date=23 June 2020 |access-date=2021-02-14 |website=docs.python.org}}</ref> need to be modified.<ref>{{Cite web |title=PEP 623 – Remove wstr from Unicode |url=https://www.python.org/dev/peps/pep-0623/ |url-status=live |archive-url=https://web.archive.org/web/20210305153214/https://www.python.org/dev/peps/pep-0623/ |archive-date=5 March 2021 |access-date=2021-02-14 |website=Python.org |language=en}}</ref> Python 3.13 introduces some changes in behavior, i.e., new "well-defined semantics", fixing bugs, and removing many deprecated classes, functions and methods (as well as some of the Python/C API and outdated modules). <!-- PEP 594 (Removing dead batteries from the standard library) scheduled removals of many deprecated modules: aifc, audioop, chunk, cgi, cgitb, crypt, imghdr, mailcap, msilib, nis, nntplib, ossaudiodev, pipes, sndhdr, spwd, sunau, telnetlib, uu, xdrlib, lib2to3. Many other removals of deprecated classes, functions and methods in various standard library modules. C API removals and deprecations. -->"<!--In early versions of Python all namespaces, whether in functions, classes or modules, were all implemented the same way: as a dictionary. .. -->The <!-- current --> old implementation of <code>locals()</code> and <code>frame.f_locals</code> was slow, inconsistent and buggy, <!--. We want to make it faster, consistent, and most importantly fix the bugs. .. Worse than that, the current behavior can result in strange bugs. There are no compensating advantages for the current behavior; it is unreliable and slow. .. The current implementation --> and it had many corner cases and oddities. Code that works around those may need revising; code that uses <code>locals()</code> for simple templating or print debugging should continue to work correctly.<!-- Debuggers and other tools that use <code>f_locals</code> to modify local variables, will now work correctly, even in the presence of threaded code, coroutines and generators. -->"<ref>{{Cite web |title=PEP 667 – Consistent views of namespaces {{!}} peps.python.org |url=https://peps.python.org/pep-0667/ |access-date=2024-10-07 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref> Python 3.13 introduces the experimental free-threaded build mode, which disables the Global Interpreter Lock (GIL); the GIL is a feature of CPython that previously prevented multiple threads from executing Python bytecode simultaneously. This optional build, introduced through PEP 703, enables better exploitation of multi-core CPUs. By allowing multiple threads to run Python code in parallel, the free-threaded mode addresses long-standing performance bottlenecks associated with the GIL. This change offers a new path for parallelism in Python, without resorting to multiprocessing or external concurrency frameworks.<ref>{{Cite web |title=PEP 703 – Making the GIL Optional in CPython |url=https://peps.python.org/pep-0703/ |access-date=2025-03-30 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref> Regarding annotations in upcoming Python version: <!-- has changes for annotations, and more/PEP 765 <!- "PEP 563 [for Python 3.7 also] changed the semantics of annotations. ->, with PEP 649 "[preserving] nearly all existing behavior of annotations from stock semantics<!- .. This will print <class 'str'> with stock semantics and <class 'int'> when this PEP is active. This is therefore a backwards-incompatible change. However, this example is poor programming style, so this change seems acceptable. ->".<ref>{{Cite web |title=PEP 649 – Deferred Evaluation Of Annotations Using Descriptors {{!}} peps.python.org |url=https://peps.python.org/pep-0649/ |access-date=2024-10-16 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref> PEP 649 is an "Accepted PEP" and implemented in 3.14: -->"In Python 3.14, <code>from __future__ import annotations</code> will continue to work as it did before, converting annotations into strings."<!-- I think there's a minor breaking change if this is *omitted*, though I'm not sure omitting it was valid before while using annotations. "Since PEP 649 was written, Python 3.12 and 3.13 gained support for several new features that also use deferred evaluation, similar to the behavior this PEP proposes for annotations:"--><ref>{{Cite web |title=PEP 749 – Implementing PEP 649 {{!}} peps.python.org |url=https://peps.python.org/pep-0749/ |access-date=2024-11-20 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref> <!-- I.e. I'm not sure this is still valid, needing a warning here: https://peps.python.org/pep-0649/ "This PEP preserves nearly all existing behavior of annotations from stock semantics: .. Since delaying the evaluation of annotations until they are introspected changes the semantics of the language, it's observable from within the language. Therefore it's ''possible'' to write code that behaves differently based on whether annotations are evaluated at binding time or at access time" --> Python 3.14 drops the [[Pretty Good Privacy|PGP]] digital verification signatures, it had deprecated in version 3.11, when its replacement Sigstore was added for all CPython artifacts; the use of PGP has been criticized by security practitioners<!-- "for years now" -->.<ref>{{Cite web |title=PEP 761 – Deprecating PGP signatures for CPython artifacts {{!}} peps.python.org |url=https://peps.python.org/pep-0761/ |access-date=2025-01-06 |website=Python Enhancement Proposals (PEPs) |language=en}}</ref> Some additional standard-library modules will be removed in Python 3.15 or 3.16, as will be many deprecated classes, functions and methods.<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><ref>{{cite web |title=PEP 594 – Removing dead batteries from the standard library |url=https://peps.python.org/pep-0594/ |website=Python Enhancement Proposals |publisher=Python Software Foundation |date=20 May 2019}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)