I find it interesting how implementing a simple algorithm can teach you so many new things.
I was recently implementing the fractional knapsack problem
The interesting was – during implementation I got to learn some interesting things about Python.
I came across this very interesting series of blog posts. The authos (Jeff Knupp) discusses some nuances in Python
There are a bunch of “Improve Your Python” articles in that blog. Check them out.
I recently came across this interesting article on class attributes v/s instance attributes in Python.
I recently used the factory Pattern in Python.
It was a little surprising to me comparing typical usage of this pattern in C# v/s Python.
In particular, in C# you’s typically have an Interface defining the methods and then provide an implementation of these methods in the concrete classes.
In Python, there is no interface – In the example above I embed a static method in the base to select the appropriate derived class.
Recently, I hit a nasty bug while working with temp files in Python.
The issue was manifesting itself in Windows. Interestingly I wasnt hitting it on Linux.
The issue was because of a leaked file descriptor. The following link explains the issue