Blog

pyproject-pub: A simple Python project template

I hate repeating myself. It's boring. Life is too short. Like any self respecting hacker I will go out of my way to avoid it, even when I suspect it would cost me more to automate …

Blog

Getting started with Python and Lisp

A few weeks ago I talked with a friend studying computer science who I discovered had never experienced the joy of programming with a high level language. Not only that but he …

Blog

Python optimization principles and methodology

Methodology The basic methodology for optimization: Discover where you program is spending its time (hotspots vs coolspots) A good way to get an overview is to use the Python …

Blog

4 simple software optimization tips

1) Always be experimenting! Trying to squeeze out more performance out of your program? Don't be afraid to experiment! In practice what that means is you setup small, simple …

Blog

Python iterators considered harmful

I just tracked down a nasty bug in my code to a gotcha with Python iterators. Consider the following code... class Numbers(list): def even(self): for val in self: if val % 2 == 0: …

Blog

Python property gotcha

If you like using a single getter/setter function for your properties, watch out if using None for the default. If you do that you won't be able to set your property to None! …

Blog

My code refactoring algorithm

You're looking at a block of Python code. It's not immediately obvious what it does. It's sort of a mess and you realize it needs to be refactored. But how? What mental algorithm …

Blog

Practical guidelines for beautiful Python code

Every now and then Liraz and I find ourselves chatting about how much we love Python, but more so the lessons we have learned from coding, and how to apply them to create …

Blog

To Lisp or not to Lisp, that is the question.

Musings on Lisp by a routinely Pythonic programmer Last week I did some maintenance on various Python projects I haven't touched in years (literally), and I was surprised by how …