Introduction to CPython

CPython is the implementation of Python in C. CPython is original Python Implementation. It is the reference implementation of the Python Programming language. It is written in C and Python. It is default and most widely used implementation of the language. It is used to work with C application. It has a foreign function interface with several languages including C.

CPython can be defined as both an interpreter and a compiler as it compiles Python code into bytecode before interpreting it. It is a Python flavour that most of us use in our day to day basis.

CPython does not translate any Python code to C. Instead it compiles any Python code into bytecode is then interpreted through an evaluation process. So to simplify the most commonly used Python-the-language is developed and interpreted using CPython as the base.

It is distributed in large standard library written in a mixture of C and Python. It provides the highest level of compatibility with Python packages and C extension modules.

All versions of the Python language are implemented in C because CPython is the reference implementation.

Tags