{"id":15036828,"url":"https://github.com/zpoint/cpython-internals","last_synced_at":"2025-05-14T14:09:25.879Z","repository":{"id":37773853,"uuid":"181513363","full_name":"zpoint/CPython-Internals","owner":"zpoint","description":"Dive into CPython internals, trying to illustrate every detail of CPython implementation","archived":false,"fork":false,"pushed_at":"2024-07-08T03:55:22.000Z","size":35074,"stargazers_count":4257,"open_issues_count":4,"forks_count":450,"subscribers_count":334,"default_branch":"master","last_synced_at":"2025-04-10T03:49:44.173Z","etag":null,"topics":["c","cpython","cpython-internals","interpreter","learning-material","python","python3"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zpoint.png","metadata":{"files":{"readme":"README.md","changelog":"change_code_reference.py","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-15T15:16:42.000Z","updated_at":"2025-04-10T02:39:49.000Z","dependencies_parsed_at":"2024-07-08T05:03:39.316Z","dependency_job_id":null,"html_url":"https://github.com/zpoint/CPython-Internals","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpoint%2FCPython-Internals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpoint%2FCPython-Internals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpoint%2FCPython-Internals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zpoint%2FCPython-Internals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zpoint","download_url":"https://codeload.github.com/zpoint/CPython-Internals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254160556,"owners_count":22024571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cpython","cpython-internals","interpreter","learning-material","python","python3"],"created_at":"2024-09-24T20:32:27.838Z","updated_at":"2025-05-14T14:09:20.865Z","avatar_url":"https://github.com/zpoint.png","language":"C","readme":"# Cpython Internals![image title](http://www.zpoint.xyz:8080/count/tag.svg?url=github%2FCPython-Internals)\n\n![cpython logo](https://docs.google.com/drawings/d/e/2PACX-1vQKKPvv9xI22zZcRtElIMx_-G22qYcLUvl-gbngubjf76dr80ZjsYQZCCKVqEvJnmBnwZyDXqG9GPlu/pub?w=300\u0026h=200) \n\n* [简体中文](https://github.com/zpoint/CPython-Internals/blob/master/README_CN.md)\n* [한국어](https://github.com/zpoint/CPython-Internals/blob/master/README_KR.md)\n*  **Watch** this repo if you need to be notified when there's update\n\nThis repository is my notes/blog for [cpython](https://github.com/python/cpython) source code\n\nTrying to illustrate every detail of cpython implementation\n\n```shell script\n# based on version 3.8.0a0\ncd cpython\ngit reset --hard ab54b9a130c88f708077c2ef6c4963b632c132b3\n```\n\nThe following contents are suitable for those who have python programming experience and interested in internal of python interpreter, for those who needs beginner or advanced material please refer to [awesome-python-books](https://github.com/Junnplus/awesome-python-books)\n\n# Table of Contents\n\n* [Objects](#Objects)\n* [Modules](#Modules)\n* [Lib](#Lib)\n* [Interpreter](#Interpreter)\n* [Extension](#Extension)\n* [Learning material](#Learning-material)\n* [Contribution](#Contribution)\n* [License](#License)\n\n\n# Objects\n - [x] [dict](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/dict/dict.md)\n - [x] [long/int](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/long/long.md)\n - [x] [unicode/str](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/str/str.md)\n - [x] [set](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/set/set.md)\n - [x] [list(timsort)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/list/list.md)\n - [x] [tuple](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/tuple/tuple.md)\n - [x] [bytes](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/bytes/bytes.md)\n - [x] [bytearray(buffer protocol)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/bytearray/bytearray.md)\n - [x] [float](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/float/float.md)\n - [x] [func(user-defined method)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/func/func.md)\n - [x] [method(builtin method)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/method/method.md)\n - [x] [iter](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/iter/iter.md)\n - [x] [gen(generator/coroutine/async generator)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/gen/gen.md)\n - [x] [class(bound method/classmethod/staticmethod)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/class/class.md)\n - [x] [complex](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/complex/complex.md)\n - [x] [enum](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/enum/enum.md)\n - [x] [type(mro/metaclass/creation of class/instance)](https://github.com/zpoint/CPython-Internals/blob/master/BasicObject/type/type.md)\n\n# Modules\n\n - [ ] io\n \t- [x] [fileio](https://github.com/zpoint/CPython-Internals/blob/master/Modules/io/fileio/fileio.md)\n - [x] [pickle](https://github.com/zpoint/CPython-Internals/blob/master/Modules/pickle/pickle.md)\n\n# Lib\n\n - [x] [re(regex)](https://github.com/zpoint/CPython-Internals/blob/master/Modules/re/re.md)\n - [ ] asyncio\n\n# Interpreter\n\n - [x] [gil(Global Interpreter Lock)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/gil/gil.md)\n - [x] [gc(Garbage Collection)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/gc/gc.md)\n - [x] [memory management](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/memory_management/memory_management.md)\n - [x] [descr(how does attribute access work/`__get__`/`__getattribute__`/`__getattr__`)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/descr/descr.md)\n - [x] [exception(exception handling)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/exception/exception.md)\n - [x] [module(how does import work)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/module/module.md)\n - [x] [frame](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/frame/frame.md)\n - [x] [code](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/code/code.md)\n - [x] [slots/`__slots__`(how does attribute initialized in the creation of class/instance)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/slot/slot.md)\n - [x] [thread](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/thread/thread.md)\n - [x] [PyObject(overview)](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/pyobject/pyobject.md)\n\n# Extension\n\n - [x] [C API(profile python code and write pure C extension)](https://github.com/zpoint/CPython-Internals/blob/master/Extension/C/c.md)\n - [ ] Cython(C extension)\n - [x] [Boost C++ libaries (C\\+\\+ extension)](https://github.com/zpoint/Boost-Python-Examples)\n - [ ] [C++ extension](https://github.com/zpoint/CPython-Internals/blob/master/Extension/CPP/cpp.md)\n \t- [x] integrate with NumPy\n \t- [x] bypass the GIL\n\n# Grammar\n\n - [x] [Compile Phase](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/compile/compile.md)\n    - [x] [Grammar/MetaGrammar to DFA](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/compile/compile.md)\n    - [x] [CST to AST](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/compile2/compile.md)\n    - [x] [AST to python byte code](https://github.com/zpoint/CPython-Internals/blob/master/Interpreter/compile3/compile.md)\n\n\n# Learning material\n\nI will only recommend what I've read\n\n* [CPython internals - Interpreter and source code overview(youtube video)](https://www.youtube.com/watch?v=LhadeL7_EIU\u0026list=PLzV58Zm8FuBL6OAv1Yu6AwXZrnsFbbR0S)\n* [\u003c \u003c Inside The Python Virtual Machine \u003e \u003e](https://leanpub.com/insidethepythonvirtualmachine)\n* [\u003c \u003c Python源码剖析 \u003e \u003e](https://book.douban.com/subject/3117898/)\n* [rushter(blog/eng)](https://rushter.com/)\n* [YET ANOTHER PYTHON INTERNALS BLOG(blog/eng)](https://pythoninternal.wordpress.com/)\n* [Junnplus(blog/cn)](https://github.com/Junnplus/blog/issues)\n* [manjusaka(blog/cn)](https://manjusaka.itscoder.com/)\n* [aoik-Python's compiler series(blog/eng)](https://aoik.me/blog/posts/python-compiler-from-grammar-to-dfa)\n\n# Contribution\n\nAll kinds of contributions are welcome\n\n* submit a pull request\n  *  if you want to share any knowledge you know\n  * post a new article\n  * correct any technical mistakes\n  * correct english grammar\n  * translation\n  * anything else\n* open an issue \n  * any suggestions\n  * any questions\n  * correct mistakes\n  * anything else\n\n# [License](https://creativecommons.org/licenses/by-nc-sa/4.0/)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpoint%2Fcpython-internals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzpoint%2Fcpython-internals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzpoint%2Fcpython-internals/lists"}