CPython
Developer(s) | Python core developers and the Python community, supported by the Python Software Foundation |
---|---|
Stable release |
3.5.2 / 27 June 2016 2.7.12 / 25 June 2016 |
Repository |
hg |
Written in | C |
Platform | 42 platforms; see § Supported platforms |
Type | Python Programming Language Interpreter |
License | Python Software Foundation License |
Website |
www |
CPython is the default, most widely used implementation of the Python programming language. It is written in C. CPython is a source code interpreter. It has a foreign function interface with several languages including C, in which one must explicitly write bindings in a language other than Python.
Alternatives
CPython is one of several "production-quality" Python implementations including: Jython, written in Java for the Java virtual machine (JVM), PyPy, written in RPython and translated into C, and IronPython, which is written in C# for the Common Language Infrastructure. There are also several experimental implementations.[1]
Concurrency issues
A significant limitation of CPython is the use of a global interpreter lock (GIL) on each CPython interpreter process, which effectively disables concurrent Python threads within one process.[2] Concurrency can only be achieved with separate CPython interpreter processes managed by a multitasking operating system. This complicates communication between concurrent Python processes, though the multiprocessing module mitigates this somewhat. Much discussion took place on whether to remove the GIL from CPython. A set of "free threading" patches to CPython was submitted by Greg Stein, which effectively replaced GIL with fine-grained locking. However the patches were rejected due to the execution overhead they introduced into single-process code.[3]
Supported platforms
Supported platforms include:[4]
Unix-like
- AIX
- BSD
- Darwin
- FreeBSD
- HP-UX
- illumos
- IRIX 5 and later (unsupported in 3.x)[5]
- Plan 9
- OS X
- NetBSD
- Linux
- OpenBSD
- Solaris
- Tru64
Special and embedded
- GP2X
- iPodLinux
- Nintendo DS
- Nintendo Gamecube
- Symbian OS Series60
- Nokia 770 Internet Tablet
- Nokia N800
- Nokia N810
- Nokia N900
- Palm OS
- PlayStation 2
- PlayStation 3 (FreeBSD)
- Psion
- QNX
- Sharp Zaurus
- Xbox/XBMC
- VxWorks
- Openmoko
- Apple iOS
- Android
- BlackBerry 10
Other
- AROS
- VMS (unsupported since 3.3)
- OS/2 (unsupported since 3.3)
- OS/390
- RISC OS (unsupported since 3.0)
- Windows XP and later
- Windows 2000 (unsupported since 3.3)
- z/OS
Previously supported platforms
PEP 11[6] lists platforms which are not supported in CPython by Python Software Foundation. These platforms can still be supported by external ports. See below.
- AtheOS (unsupported since 2.6)
- BeOS (unsupported since 2.6)
- DOS (unsupported since 2.0)
- IRIX 4 (unsupported since 2.3)
- Mac OS 9 (unsupported since 2.4)
- MINIX (unsupported since 2.3)
- Windows 3.x (unsupported since 2.0)
- Windows 9x (unsupported since 2.6)
- Windows NT4 (unsupported since 2.6)
External ports
These are ports not integrated to Python Software Foundation's official version of CPython, with links to its main development site. Ports often include additional modules for platform-specific functionalities, like graphics and sound API for PSP and SMS and camera API for S60.
- Amiga: AmigaPython[7]
- AS/400: iSeriesPython[8]
- DOS using DJGPP: PythonD[9]
- PlayStation Portable: Stackless Python for PSP[10]
- Symbian OS: Python for S60
- Windows CE/Pocket PC: Python Windows CE port[11]
Version history
Version | Release date | Supported until |
---|---|---|
2.2 | 2001-12-21[12] | 2003-05-30[13] |
2.3 | 2003-07-29[14] | 2008-03-11[15] |
2.4 | 2004-11-30[16] | 2008-12-19[17] |
2.5 | 2006-09-19[18] | 2011-05-26[19] |
2.6 | 2008-10-01[20] | 2013-10-29[21] |
2.7 | 2010-07-03[22] | 2020[23] |
3.0 | 2008-12-03[24] | 2009-06-27[25] |
3.1 | 2009-06-27[26] | 2014-06[27] |
3.2 | 2011-02-20[28] | 2016-02[29] |
3.3 | 2012-09-29[30] | 2017-09[31] |
3.4 | 2014-03-17[32] | 2019-03 |
3.5 | 2015-09-13[33] | 2020-09 |
3.6 | 2016-12-16[34] | 2021-12[34] |
Old version Older version, still supported Latest version Future release |
Unladen Swallow
Unladen Swallow was an optimization branch of CPython, intended to be fully compatible and significantly faster. It aimed to achieve its goals by supplementing CPython's custom virtual machine with a just-in-time compiler built using LLVM.
The project had stated a goal of a speed improvement by a factor of five over CPython;[35] this goal was not met.[36]
The project was sponsored by Google, and the project owners, Thomas Wouters, Jeffrey Yasskin, and Collin Winter, are full-time Google employees,[37] however most project contributors are not Google employees.[38] Unladen Swallow is hosted on Google Code.[39]
Like many things regarding the Python language, the name Unladen Swallow is a Monty Python reference, specifically to the joke about the airspeed velocity of unladen swallows in Monty Python and the Holy Grail.
Although it fell short of all published goals, Unladen Swallow did produce some code which got added to the main Python implementation, such as improvements to the cPickle module.[40]
Project activity
In July 2010, some observers speculated on whether the project was dead or dying, since the 2009 Q4 milestone had not yet been released.[41] The traffic on Unladen's mailing list had decreased from 500 messages in January 2010, to fewer than 10 in September 2010.[42] It has also been reported that Unladen lost Google's funding.[43] In November 2010, one of the main developers announced that "Jeffrey and I have been pulled on to other projects of higher importance to Google".[44]
The 2009 Q4 development branch was created on January 26, 2010,[45] but no advertising was made on the website. Further, regarding the long-term plans, and as the project missed the Python 2.7 release, a Python Enhancement Proposal (PEP)[36] was accepted, which proposed a merge of Unladen Swallow into a special py3k-jit branch of Python's official repository. As of July 2010, this work was ongoing.[46] This merging would have taken some time, since Unladen Swallow was originally based on Python 2.6[47] with which Python 3 broke compatibility (see Python 3000 for more details). However, the PEP was subsequently withdrawn.
In early 2011, it became clear that the project was stopped.[48]
Milestones
References
- ↑ Martelli, Alex (2006). Python in a Nutshell (2nd ed.). O'Reilly. pp. 5–7. ISBN 978-0-596-10046-9.
- ↑ "Initialization, Finalization, and Threads — Python v2.7.6 documentation". Docs.python.org. Retrieved 2015-08-08.
- ↑ "Library and Extension FAQ". Python v3.3.0 documentation. Python Software Foundation. "Can't we get rid of the Global Interpreter Lock?". Archived from the original on March 4, 2013.
- ↑ "PythonImplementations". Retrieved 19 July 2012.
- ↑ "Irix still supported?".
- ↑ PEP 11
- ↑ AmigaPython
- ↑ iSeriesPython
- ↑ PythonD
- ↑ Stackless Python for PSP
- ↑ Python Windows CE port
- ↑ "Python 2.2". Python.org. Retrieved 2014-02-06.
- ↑ "Python 2.2.3". Python.org. Retrieved 2014-02-06.
- ↑ "Python 2.3". Python.org. 2003-07-29. Retrieved 2014-02-06.
- ↑ "Python 2.3.7 Release". Python.org. 2008-03-11. Retrieved 2014-02-06.
- ↑ "Python 2.4". Python.org. 2004-11-30. Retrieved 2014-02-06.
- ↑ "Python 2.4.6 Release". Python.org. 2008-12-19. Retrieved 2014-02-06.
- ↑ "Python 2.5 Release". Python.org. 2006-09-19. Retrieved 2014-02-06.
- ↑ "Python 2.5.6". Python.org. 2011-05-26. Retrieved 2014-02-06.
- ↑ "Python 2.6 Release". Python.org. 2008-10-01. Retrieved 2014-02-06.
- ↑ "Python 2.6.9 Release". Python.org. 2013-10-29. Retrieved 2014-02-06.
- ↑ "Python 2.7 Release". Python.org. 2010-07-03. Retrieved 2014-02-06.
- ↑ "PEP 373 - Python 2.7 Release Schedule". Python.org. Retrieved 2014-02-06.
- ↑ "Python 3.0 Release". Python.org. 2008-12-03. Retrieved 2014-02-06.
- ↑ "Python 3.0.1 Release". Python.org. 2009-02-13. Retrieved 2014-02-06.
- ↑ "Python 3.1 Release". Python.org. 2009-06-27. Retrieved 2014-02-06.
- ↑ "PEP 375 - Python 3.1 Release Schedule". Python.org. Retrieved 2014-02-06.
- ↑ "Python 3.2 Release". Python.org. 2011-02-20. Retrieved 2014-02-06.
- ↑ "PEP 392 - Python 3.2 Release Schedule". Python.org. Retrieved 2014-02-06.
- ↑ "Python 3.3.0 Release". Python.org. 2012-09-29. Retrieved 2014-02-06.
- ↑ "PEP 398 - Python 3.3 Release Schedule". Python.org. Retrieved 2014-02-06.
- ↑ "Python 3.4.0 Release". Python.org. Retrieved 2014-04-26.
- ↑ "Python 3.5.0 Release". Python.org. Retrieved 2015-09-16.
- 1 2 "Python 3.6 Release Schedule". Python.org. Retrieved 2016-11-07.
- ↑ Paul, Ryan (2009-03-26). "Ars Technica report on Unladen Swallow goals". Arstechnica.com. Retrieved 2011-08-19.
- 1 2 Winter, Collin; Yasskin, Jeffrey; Kleckner, Reid (2010-03-17). "PEP 3146 - Merging Unladen Swallow into CPython". Python.org.
- ↑ "People working on Unladen Swallow". Retrieved 2009-09-29.
- ↑ https://code.google.com/p/unladen-swallow/people/list
- ↑ "Unladen Swallow project page". Code.google.com. Retrieved 2011-08-19.
- ↑ http://bugs.python.org/issue9410
- ↑ "Message on comp.lang.python". Groups.google.com. Retrieved 2011-08-19.
- ↑ "Unladen Swallow | Google Groups". Groups.google.com. Retrieved 2011-08-19.
- ↑ "reddit post by an Unladen committer". Reddit.com. 2010-06-24. Retrieved 2011-08-19.
- ↑ Winter, Collin (November 8, 2010). "Current status of Unladen-Swallow". Google.
- ↑ "2009 Q4 release branch creation". Code.google.com. 2010-01-26. Retrieved 2011-08-19.
- ↑ "Developers focus on merge into py3k-jit". Groups.google.com. 2010-07-13. Retrieved 2011-08-19.
- ↑ "Unladen Swallow baseline". Python.org. Retrieved 2011-08-19.
- ↑ Kleckner, Reid (26 March 2011). "Unladen Swallow Retrospective". QINSB is not a Software Blog (qinsb.blogspot.com).
- ↑ "Unladen Swallow 2009Q1". unladen-swallow, A faster implementation of Python. Retrieved 19 October 2012.
- ↑ "Unladen Swallow 2009Q2". unladen-swallow, A faster implementation of Python. Retrieved 19 October 2012.
- ↑ "Unladen Swallow 2009Q3". unladen-swallow, A faster implementation of Python. Retrieved 19 October 2012.