Python Internals - I Made Addition Unpredictable
Source: https://arpitbhayani.me/blogs/i-changed-my-python Date: 2020-01-03
Explore Python internals by tweaking its source code! Learn how I made addition unpredictable and the challenges I faced.
Did you ever take a peek at Python’s source code? I didn’t and hence I decided to have some fun with it this week. After cloning the repository I realized how well written is the code that makes python what it is. In the process of exploring the codebase, I thought of making some changes, not big optimizations but some minor tweaks that will help me understand how Python is implemented in C and along the course learn some internals. To make things fun and interesting I thought of changing how addition work by making it incorrect and unpredictable which means a + b will internally do one of the following operations, at random
