Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docs for the internals of CPython Implementation

Tags:

python

cpython

I am currently in the process of making an embedded system port of the CPython 3.0 Python interpreter and I'm particularly interested in any references or documentation that provides details about the design and structure of code for Release 3.0 or even about any of the 2.x releases.

One useful document I have found so far is this informational PEP on the implementation - which is a good overview - but is still pretty high level. Hoping to come across something that gives [much] more detail on more of the modules or perhaps even covers something about porting considerations.

like image 685
Tall Jeff Avatar asked Feb 22 '09 00:02

Tall Jeff


People also ask

What is CPython the default implementation?

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 Python language. CPython can be defined as both an interpreter and a compiler as it compiles Python code into bytecode before interpreting it.

Is CPython an interpreter or compiler?

Python is an interpreted language, which means the source code of a Python program is converted into bytecode that is then executed by the Python virtual machine. Python is different from major compiled languages, such as C and C + +, as Python code is not required to be built and linked like code for these languages.


2 Answers

There's the documentation for the C API, which is essentially the API for the internals of Python. It won't cover porting details, though. The code itself is fairly well documented. You might try reading in and around the area you'll need to modify.

like image 160
Ned Batchelder Avatar answered Sep 23 '22 21:09

Ned Batchelder


Most of the documentation is stored in the minds of various core developers. :) A good resource for you would be the #python-dev IRC channel on freenode where many of them hang out.

There's also some scattered information on the Python wiki.

like image 36
Benjamin Peterson Avatar answered Sep 23 '22 21:09

Benjamin Peterson