CPython

From Wikipedia, the free encyclopedia
Jump to: navigation, search
Not to be confused with Cython.
CPython
Python logo.svg
Developer(s) Python core developers and the Python community, supported by the Python Software Foundation
Stable release 3.3 / September 29, 2012; 7 months ago (2012-09-29)
Written in C
Platform Cross-platform
Type Python Programming Language Interpreter
License Python Software Foundation License
Website www.python.org

CPython is the default, most-widely used implementation of the Python programming language. It is written in C. In addition to CPython, there are other "production-quality" Python implementations: Jython, written in Java, PyPy and IronPython, which is written for the Common Language Infrastructure. There are also several experimental implementations.[1]

CPython is a bytecode 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.

Contents

Supported platforms[2] [edit]

Unix-like
Special and embedded
Other

Previously supported platforms [edit]

PEP 11 lists platforms which are not supported in CPython by Python Software Foundation. These platforms can still be supported by external ports. See below.

External ports [edit]

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.

Concurrency issues [edit]

A significant drawback to using CPython on a multitasking computer is the presence of a Global Interpreter Lock on each CPython interpreter process, which effectively disables concurrent Python threads within one process.[3] To be truly concurrent in multitasking environment, separate CPython interpreter processes have to be run, which makes establishing communication between them a difficult task, though the multiprocessing module mitigates this somewhat. There is occasional discussion whether to remove the GIL from CPython.[4]

References [edit]

  1. ^ Martelli, Alex (2006). Python in a Nutshell (2nd edition ed.). O'Reilly. pp. 5–7. ISBN 978-0-596-10046-9. 
  2. ^ "PythonImplementations". Retrieved 19 July 2012. 
  3. ^ Python/C API Reference Manual: Thread State and the Global Interpreter Lock
  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 March 4, 2013.