Release 0.2, Fixing my own mistake
During Release 0.2, I found a nice little Project. This project was very simple, we just needed to create, and add simple math functions in Python.
I actually contributed a lot on that repo, but I chose this PR because it was unique.
To give a bit of context, this was the initial Issue that I’ve posted, and worked on during Hacktoberfest. It’s a simple function that converts a decimal number into a Roman Numeral equivalent. After sometime, the PR I’ve created had got accepted. Great!… right? No, not great.
As soon as my PR got accepted, someone found a bug within the function that I’ve made. How significant was the bug? Well, if I passed a number that ends in 4 (i.e, 664, 544, 4, etc.) the function crashes. The TypeError in question complains about me multiplying String types. Well…. oops.
Well, the fix was quite simple. I just replaced ‘*’ with ‘+’, and yay! It’s fixed.
I chose to blog about this, just cause I fixed the bug that I’ve created, and it can happen. What’s great is that there are people that tell you how bad your code is, without being mean. That’s how Open Source works!