Python

From Python to Go

I have been programming in Python in one capacity or another since around 2000. That’s almost 15 years. Over those years, I’ve come to know the language fairly well. I originally came to Python from C and Perl, and it was quite refreshing to come to a language that is simple to use, has a consistent syntax and library, and is quite powerful.

Continue reading

A subprocess bug? Nah.

A few weeks ago, a colleague came to me with an interesting bug: When running a child process with Python’s subprocess module, no exception is thrown when the child process fails. In essence, what happened was the following (typed at the interactive Python prompt):

Continue reading

Buffers will fill up... eventually

A colleague asked me to look into a problem with him, mentioning that “Tlib hangs when we run it”. Tlib is a fairly large project that is written in Python. His initial analysis showed that it hangs at a very early phase, during with it tries to fetch the latest version to run from a git server.

Continue reading

Improving readability and flow control in Python

Recently, a colleague and I refactored a piece of existing code that had new behavior added to it. During the process, we managed to improve the readability of the code using several techniques that I’ll describe below.

Continue reading