You're Too Close

Have you encountered the following scenario? You are trying to solve a problem (or helping solve a problem) and know or at least think you know the solution.  You are in the middle of implementing it when someone else looks at it and says, "why don't you do it this…

The Python "in" Operator – Theoretical vs Actual Time Complexity

Background Sometimes we may generate or retrieve a list, set or even dict when creating collection of things that we will be testing against.  Theoretically a set, frozenset or dictionary should be the fastest (and equivalent) forms of storage for this operation.  However, what I've found is that on some…

Not Invented Here, Not Written By Me, and Reinventing The Wheel

Not invented here and not written by me are both driving factors in reinventing the wheel when developing software. We limit ourselves if we do not build upon the achievements of others. - Chad Dotson Not Invented Here I'm sure everyone has encountered developers that would prefer to implement everything…

C-Style Unions And Python

So, you're creating a C Union (used to create a variant type) and writing it to a file, socket, etc and want to read that in Python. There are two ways to deal with this. Assume the following union definition in C typedef union { int i; unsigned int u;…