
While writing a chess program in Python as a learning exercise, I had two separate functions for converting a position from an algebraic notation string, 'a1'
, to a tuple, (97, 1)
, and vice versa. I later merged the two functions into a static method for the Board class. The code works. I should have left it at that and move on.
I found any interesting situation when refactoring the code to work with @functools.singledispatch
and @staticmethod
in a class. The code worked but I was using the wrong single dispatch decorator. When is a bug not a bug?
Read my essay and follow me on Medium. Your support is greatly appreciated.