Walkthrough cpython 3.6 source code

Prashanth Raghu (~PrashanthRaghu)




This talk will be an introduction to cpython from a source code level. We will walk through the source code of python from the parser, compiler, assembler and interpreter phases. We will also understand the design of the garbage collector, memory allocator from a source code perspective. We shall also explore the different design philosophies of cpython. There will be special emphasis on python objects such as lists, tuples, dictionaries etc and their design internals. This talk is for people who are interested to explore how cpython works internally.


  1. Python source code.
  2. gdb
  3. eclipse latest version
  4. linux
  5. make

Content URLs:

Please read the books available for free download from


The books are authored by the same speaker.

Speaker Info:

I am Prashanth Raghu and my interest in python began back in 2009 when I was studying at PES University, Bangalore. I used python as a part of my internship project in my final year. It was used to develop a hybrid cloud app with the web front end designed in PHP and monitoring and load testing on python. I was a Google Summer of Code scholar for the year 2014. ( My work: https://github.com/openstack/zaqar/tree/master/zaqar/storage/redis ).

I studied at National University of Singapore and did my Masters in Wireless Computation with a research paper between 2013-2014. I was struck by a rare disease called Steven Johnson Syndrome in 2015 due to this my startup failed. At this crucial time I decided to do something of my interest and opened up the source code of python 2.7. I was amazed at the simplicity yet profoundness of the architecture and decided to share my views with the world. And the result of my efforts for a couple of months has resulted into the book “Internals of Cpython 2.7” and “Internals of Cpython3.6” available as a free download under CC 4.0 license.

Speaker Links:

Section: Core Python
Type: Workshops
Target Audience: Advanced
Last Updated:

Will be occupying front seats for this talk.

T K Sourabh (~sourabhtk37)

Thanks mate. Will surely help you getting introduced to the "Internals of Cpython". Would also like to know if there is anything is particular u would like to know about or curious.

Prashanth Raghu (~PrashanthRaghu)

Definitely would be interesting to see memory management and how everything is represented as objects in CPython. Also would be happy to see various trade-off done to achieve performance.

T K Sourabh (~sourabhtk37)

Definitely. The talk begins with how objects are represented in Cpython and later we will also cover memory management. The last part of the talk will be about performance hacks. I would suggest you to just have a look at my books from http://intopython.com/.

Prashanth Raghu (~PrashanthRaghu)

The proposal is commendable. Good that you decided to do this as a workshop instead of a talk. I was going through your PDFs. While its very visual, interactive and detailed, I am afraid there are no basics or introductory parts about the parts of Python - the source code tree, where the different parts - the parser, lexer, grammar etc sits.

I'd suggest to first give an overview of this before you deep dive to the talk so that audience has got their grounding before they jump to the details. Otherwise its easy to get lost.

Anand B Pillai (~pythonhacker)

Thanks for the comments. Very true. Yes those parts were missed in the book. I will keep a note of these points in my talk.

Prashanth Raghu (~PrashanthRaghu)

Wow! Your book looks really cool. Will definitely attend this talk and read the book once I find a free weekend. Just curious though, why Eclipse?

Shreyans Doshi (~shreyans51)

@shreyans51: Thank you. Ha ha eclipse because I like it for C/C++ debugging. There is also a version of my book edited by my friend Louie Lu which uses gdb.


Although the book uses gdb I feel that it's not a complete rewrite of my book as it does not contain screenshots and other debugging tips I have suggested.

Prashanth Raghu (~PrashanthRaghu)

Hi, It would be nice if you add your slides too. It will help our team to review your proposal. Thanks

Rajat Saini (~rajataaron)

I will do that. Thanks.

Prashanth Raghu (~PrashanthRaghu)

Login to add a new comment.