Hacker News Viewer

CPython Internals Explained

by yufiz on 1/27/2026, 2:07:37 PM

https://github.com/zpoint/CPython-Internals

Comments

by: squeedles

Had to write a fairly substantial native extension to Python a couple years ago and one of the things I enjoyed was that the details were not easily &quot;Googleable&quot; because implementation results were swamped by language level results.<p>It took me back to the old days of source diving and accumulated knowledge that you carried around in your head.<p><a href="https:&#x2F;&#x2F;www.dave.org&#x2F;posts&#x2F;20220806_python&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.dave.org&#x2F;posts&#x2F;20220806_python&#x2F;</a>

1/31/2026, 6:21:10 PM


by: westurner

vstinner&#x27;s Python docs; &quot;Unofficial Python Development (Victor&#x27;s notes) documentation&quot; &gt; Garbage Collector &gt; &quot;Implement the GC protocol in a type&quot;: <a href="https:&#x2F;&#x2F;pythondev.readthedocs.io&#x2F;garbage_collector.html#implement-the-gc-protocol-in-a-type" rel="nofollow">https:&#x2F;&#x2F;pythondev.readthedocs.io&#x2F;garbage_collector.html#impl...</a><p>Python Developer&#x27;s Guide &gt; &quot;CPython&#x27;s internals&quot;: <a href="https:&#x2F;&#x2F;devguide.python.org&#x2F;internals&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;devguide.python.org&#x2F;internals&#x2F;index.html</a><p>Python&#x2F;cpython&#x2F;&#x2F;InternalDocs&#x2F;README.md &gt; &quot;CPython Internals Documentation&quot;: <a href="https:&#x2F;&#x2F;github.com&#x2F;python&#x2F;cpython&#x2F;blob&#x2F;main&#x2F;InternalDocs&#x2F;README.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;python&#x2F;cpython&#x2F;blob&#x2F;main&#x2F;InternalDocs&#x2F;REA...</a>

1/31/2026, 5:51:28 PM


by: mvATM99

Very interesting! Gonna look through this for sure in the next weeks

1/31/2026, 4:44:38 PM


by: tonymet

I wish they would just go back to calling it Python, since it’s the Python that everyone knows and uses. No one gets confused over Python the spec and Python the implementation. Every time I see “CPython” i have to double check we’re just talking about Python.<p>I guess they “CPython’ed” back when people thought Jython would take off , and it never did because Java sucks.

1/31/2026, 5:08:29 PM


by:

1/31/2026, 4:45:08 PM


by: damjon

I&#x27;ve been comparing various platforms and discussing them with ChatGPT—for instance, why Python&#x27;s execution is slower than JavaScript&#x27;s V8. It claimed this is due to mtechnical debt and the inability to change because libraries like NumPy bypass public interfaces and access data directly.<p>I&#x27;m wondering how much of that is true and what is just a hallucination.&quot;<p>Btw: JavaScript seems to have similar complexity issues.<p>Edit: Python has no JIT

1/31/2026, 5:02:21 PM