Playback speed
undefinedx
Share post
Share post at current time
0:00
/
0:00

Implementation of the Float Built-in Type in CPython

Welcome to the last and final video of the CPython Type System Internals series. We will conclude by looking at the implementation of the float type in CPython. This will help us solidify our understanding of how the various types work under the hood.

If you watch till the end, you will also find something interesting. We will modify the float implementation, and add a small feature to it (well “feature” is really glorifying it).

Links to All the Videos of this Series

  1. Design of the CPython Type System

  2. Emulating Inheritance and Polymorphism in C

  3. Decoding PyObject and PyTypeObject in CPython

  4. Implementation of the Float Built-in Type in CPython

Conclusion

With this, we have covered everything we wanted to about the CPython type system implementation. The really important bit to understand is the role of PyObject and PyTypeObject structs because they are used throughout the rest of the CPython code. And this should give us a solid footing to go higher up study more interesting bits of CPython.

If you have any questions, feel free to ask in comments, or reach out to me on X/Twitter.

Support Confessions of a Code Addict

I’ve been working on Confessions of a Code Addict full time which has allowed me to give my 100% to everything I produced. If you enjoy these pieces, and find them valuable then please consider supporting me by becoming a paid subscriber or buying me a coffee.

Note that the pricing will show to you in Indian Rupees (INR). The monthly plan is priced at INR 550 ($6.60) and the annual plan is priced at INR 4999 ($60). If you work in a tech company, you may be able to expense it as part of your learning budget as well.

0 Comments
Confessions of a Code Addict
Confessions of a Code Addict Podcast
Deep dives into varied topics on Computer Science including compilers, programming languages, database internals, AI and more. Subscribe for insights and advance your engineering skills!