CPython

CPython
Developer(s) Python core developers and the Python community, supported by the Python Software Foundation
Stable release
3.6.5 / 28 March 2018 (2018-03-28)[1]
2.7.15 / 1 May 2018 (2018-05-01)[2]
Repository Edit this at Wikidata
Written in C, Python
Platform 42 platforms; see § Distribution
Type Python Programming Language Interpreter
License Python Software Foundation License
Website python.org

CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely-used implementation of the language.

CPython is an 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.

Design

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.[3] 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.[4]

Distribution

Supported platforms include:[5]

Unix-like
Special and embedded
Other

PEP 11[7] lists platforms which are not supported in CPython by Python Software Foundation. These platforms can still be supported by external ports. These ports include:

External ports not integrated to Python Software Foundation's official version of CPython, with links to its main development site, often include additional modules for platform-specific functionalities, like graphics and sound API for PSP and SMS and camera API for S60. These ports include:

Enterprise Linux

These Python versions are distributed with currently-supported enterprise Linux distributions[13].

Enterprise Linux
Distribution version Distribution EOL Python version
Red Hat Enterprise Linux 7 2024-06-30 Older version, yet still supported: Python 2.7[14]
Red Hat Enterprise Linux 6 2020-11-30 Old version, no longer supported: Python 2.6[15]
Red Hat Enterprise Linux 5 2020-11-30 Old version, no longer supported: Python 2.4[16]
CentOS 7 2024-06-30 Older version, yet still supported: Python 2.7[17]
CentOS 6 2020-11-30 Old version, no longer supported: Python 2.6[18]
Ubuntu 18.04 LTS (Bionic Beaver) 2023-04 Older version, yet still supported: Python 2.7 and 3.6[19][20]
Ubuntu 16.04 LTS (Xenial Xerus) 2021-04 Older version, yet still supported: Python 2.7 and 3.5[19][20]
Ubuntu 14.04 LTS (Trusty Tahr) 2019-04 Older version, yet still supported: Python 2.7 and 3.4[19][20]
Debian 9 2022-06 Older version, yet still supported: Python 2.7 and 3.5[21][22]
Debian 8 2020-04 Older version, yet still supported: Python 2.7 and 3.4[23][24]
SUSE Linux Enterprise Server 12 2027-10-31 Older version, yet still supported: Python 2.7[25]
SUSE Linux Enterprise Server 11 2022-03-31 Older version, yet still supported: Python 2.7[26]
Legend:
Old version
Older version, still supported
Latest version
Latest preview version
Future release

History

Version history

Version history
Version Release date Supported until
Old version, no longer supported: 2.0 2000-10-16[27] 2001-06-22[28]
Old version, no longer supported: 2.1 2001-04-17[29] 2002-04-08[30]
Old version, no longer supported: 2.2 2001-12-21[31] 2003-05-30[32]
Old version, no longer supported: 2.3 2003-07-29[33] 2008-03-11[34]
Old version, no longer supported: 2.4 2004-11-30[35] 2008-12-19[36]
Old version, no longer supported: 2.5 2006-09-19[37] 2011-05-26[38]
Old version, no longer supported: 2.6 2008-10-01[39] 2013-10-29[40]
Older version, yet still supported: 2.7 2010-07-03[41] 2020-01-01[42][43]
Old version, no longer supported: 3.0 2008-12-03[44] 2009-06-27[45]
Old version, no longer supported: 3.1 2009-06-27[46] 2012-04-09[47]
Old version, no longer supported: 3.2 2011-02-20[48] 2016-02-27[49]
Old version, no longer supported: 3.3 2012-09-29[50] 2017-09-29[51]
Older version, yet still supported: 3.4 2014-03-16[52] 2019-03-16[53]
Older version, yet still supported: 3.5 2015-09-13[54] 2020-09-13[55]
Older version, yet still supported: 3.6 2016-12-23[56] 2021-12-23[57]
Current stable version: 3.7 2018-06-27[58] 2023-06-27[59]
Future release: 3.8 2019-10-20[60] 2024-10[60]
Legend:
Old version
Older version, still supported
Latest version
Latest preview 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;[61] this goal was not met.[62]

The project was sponsored by Google, and the project owners, Thomas Wouters, Jeffrey Yasskin, and Collin Winter, are full-time Google employees,[63] however most project contributors are not Google employees.[64] Unladen Swallow was hosted on Google Code.[65]

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.[66]

In July 2010, some observers speculated on whether the project was dead or dying, since the 2009 Q4 milestone had not yet been released.[67] The traffic on Unladen's mailing list had decreased from 500 messages in January 2010, to fewer than 10 in September 2010.[68] It has also been reported that Unladen lost Google's funding.[69] 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".[70]

The 2009 Q4 development branch was created on 26 January 2010,[71] 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)[62] 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.[72] This merging would have taken some time, since Unladen Swallow was originally based on Python 2.6[73] 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.[74]

  • 2009 Q1[75]
  • 2009 Q2[76]
  • 2009 Q3 and beyond: reduce memory use, improve speed[77]

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.[78]

References

  1. Deily, Ned (28 March 2018). "[RELEASE] Python 3.6.5 is now available". python-announce (Mailing list). Retrieved 3 May 2018.
  2. Peterson, Benjamin (1 May 2018). "[RELEASE] Python 2.7.15". python-announce (Mailing list). Retrieved 3 May 2018.
  3. "Initialization, Finalization, and Threads". Python v2.7.6 documentation. Retrieved 2015-08-08.
  4. "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 4 March 2013.
  5. "PythonImplementations". Retrieved 19 July 2012.
  6. "Irix still supported?".
  7. PEP 11
  8. AmigaPython
  9. iSeriesPython
  10. PythonD
  11. Stackless Python for PSP
  12. Python Windows CE port
  13. https://linuxlifecycle.com
  14. "DistroWatch.com: Red Hat Enterprise Linux". DistroWatch.com. 2017-09-07. Retrieved 2017-10-15.
  15. "DistroWatch.com: Red Hat Enterprise Linux". DistroWatch.com. 2017-09-07. Retrieved 2017-10-15.
  16. "DistroWatch.com: Red Hat Enterprise Linux". DistroWatch.com. 2017-09-07. Retrieved 2017-10-15.
  17. "DistroWatch.com: CentOS". DistroWatch.com. 2017-09-14. Retrieved 2017-10-15.
  18. "DistroWatch.com: CentOS". DistroWatch.com. 2017-09-14. Retrieved 2017-10-15.
  19. 1 2 3 "python3-defaults package : Ubuntu". Canonical Ltd. 2018-06-08. Retrieved 2018-06-08.
  20. 1 2 3 "python-defaults package : Ubuntu". Canonical Ltd. 2018-06-08. Retrieved 2018-06-08.
  21. "DistroWatch.com: Debian". DistroWatch.com. 2017-10-15. Retrieved 2017-10-15.
  22. "Debian -- Details of package python3 in stretch". Retrieved 2017-12-19.
  23. "DistroWatch.com: Debian". DistroWatch.com. 2017-10-15. Retrieved 2017-10-15.
  24. "Debian -- Details of package python3 in jessie". Retrieved 2017-12-19.
  25. "DistroWatch.com: openSUSE". DistroWatch.com. 2017-10-14. Retrieved 2017-10-15.
  26. "DistroWatch.com: openSUSE". DistroWatch.com. 2017-10-14. Retrieved 2017-10-15.
  27. "Python 2.0". Python.org. Retrieved 2018-03-24.
  28. "Python 2.0.1". Python.org. Retrieved 2018-03-24.
  29. "Python 2.1". Python.org. Retrieved 2018-03-24.
  30. "Python 2.1.3". Python.org. Retrieved 2018-03-24.
  31. "Python 2.2". Python.org. Retrieved 2014-02-06.
  32. "Python 2.2.3". Python.org. Retrieved 2014-02-06.
  33. "Python 2.3". Python.org. 2003-07-29. Retrieved 2014-02-06.
  34. "Python 2.3.7 Release". Python.org. 2008-03-11. Retrieved 2014-02-06.
  35. "Python 2.4". Python.org. 2004-11-30. Retrieved 2014-02-06.
  36. "Python 2.4.6 Release". Python.org. 2008-12-19. Retrieved 2014-02-06.
  37. "Python 2.5 Release". Python.org. 2006-09-19. Retrieved 2014-02-06.
  38. "Python 2.5.6". Python.org. 2011-05-26. Retrieved 2014-02-06.
  39. "Python 2.6 Release". Python.org. 2008-10-01. Retrieved 2014-02-06.
  40. "Python 2.6.9 Release". Python.org. 2013-10-29. Retrieved 2014-02-06.
  41. "Python 2.7 Release". Python.org. 2010-07-03. Retrieved 2014-02-06.
  42. "PEP 373 - Python 2.7 Release Schedule". Python.org. Retrieved 2014-02-06.
  43. "[Python-Dev] Python 2.7 -- bugfix or security before EOL?". Guido van Rossum. Retrieved 2017-03-14.
  44. "Python 3.0 Release". Python.org. 2008-12-03. Retrieved 2014-02-06.
  45. "Python 3.0.1 Release". Python.org. 2009-02-13. Retrieved 2014-02-06.
  46. "Python 3.1 Release". Python.org. 2009-06-27. Retrieved 2014-02-06.
  47. "PEP 375 - Python 3.1 Release Schedule". Python.org. Retrieved 2014-02-06.
  48. "Python 3.2 Release". Python.org. 2011-02-20. Retrieved 2014-02-06.
  49. "PEP 392 - Python 3.2 Release Schedule". Python Software Foundation. Retrieved 2017-09-17.
  50. "Python 3.3.0 Release". Python.org. 2012-09-29. Retrieved 2014-02-06.
  51. "PEP 398 - Python 3.3 Release Schedule". Python Software Foundation. Retrieved 2017-09-17.
  52. "Python 3.4.0 Release". Python.org. Retrieved 2014-04-26.
  53. "Python Developer's Guide: Status of Python branches". Python Software Foundation. Retrieved 2017-09-17.
  54. "Python 3.5.0 Release". Python.org. Retrieved 2017-01-01.
  55. "Python Developer's Guide: Status of Python branches". Python Software Foundation. Retrieved 2017-09-17.
  56. "Python 3.6.0 Release". Python.org. Retrieved 2017-01-01.
  57. "Python Developer's Guide: Status of Python branches". Python Software Foundation. Retrieved 2018-09-19.
  58. "Python 3.7 Release Schedule". Python.org. Retrieved 2017-01-01.
  59. "Python Developer's Guide: Status of Python branches". Python Software Foundation. Retrieved 2018-09-19.
  60. 1 2 "Python 3.8 Release Schedule". Python.org. Retrieved 2017-07-02.
  61. Paul, Ryan (2009-03-26). "Ars Technica report on Unladen Swallow goals". Arstechnica.com. Retrieved 2011-08-19.
  62. 1 2 Winter, Collin; Yasskin, Jeffrey; Kleckner, Reid (2010-03-17). "PEP 3146 - Merging Unladen Swallow into CPython". Python.org.
  63. "People working on Unladen Swallow". Retrieved 2009-09-29.
  64. https://code.google.com/p/unladen-swallow/people/list
  65. "Unladen Swallow project page". Code.google.com. Retrieved 2011-08-19.
  66. http://bugs.python.org/issue9410
  67. "Message on comp.lang.python". Groups.google.com. Retrieved 2011-08-19.
  68. "Unladen Swallow | Google Groups". Groups.google.com. Retrieved 2011-08-19.
  69. "reddit post by an Unladen committer". Reddit.com. 2010-06-24. Retrieved 2011-08-19.
  70. Winter, Collin (8 November 2010). "Current status of Unladen-Swallow". Google.
  71. "2009 Q4 release branch creation". Code.google.com. 2010-01-26. Retrieved 2011-08-19.
  72. "Developers focus on merge into py3k-jit". Groups.google.com. 2010-07-13. Retrieved 2011-08-19.
  73. "Unladen Swallow baseline". Python.org. Retrieved 2011-08-19.
  74. Kleckner, Reid (26 March 2011). "Unladen Swallow Retrospective". QINSB is not a Software Blog (qinsb.blogspot.com).
  75. "Unladen Swallow 2009Q1". unladen-swallow, A faster implementation of Python. Retrieved 19 October 2012.
  76. "Unladen Swallow 2009Q2". unladen-swallow, A faster implementation of Python. Retrieved 19 October 2012.
  77. "Unladen Swallow 2009Q3". unladen-swallow, A faster implementation of Python. Retrieved 19 October 2012.
  78. Martelli, Alex (2006). Python in a Nutshell (2nd ed.). O'Reilly. pp. 5–7. ISBN 978-0-596-10046-9.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.