Tail Call Optimization Decorator in Python

This function decorates a function with tail call optimization. It does this by throwing an exception if it is it's own grandparent, and catching such exceptions to fake the tail call optimization.

Sometimes I wonder why a whole bunch of Scheme loving folks use Python. Then, I see rather clever things like this, and it starts to make more sense. I do wonder how much of a performance penalty something like this incurs, though.

Mock Objects

Brett shared this post from the Google Open Source blog. While I'm not into Python, a mock object generator seems totally awesome. (Why didn't anyone tell me about this earlier?) Anyways, the Google Blog post linked to EasyMock, which is a mock object generator for Java. Now that looks really useful, since I spend my day job hacking on a very large Java system with not enough tests. EasyMock has quickly made it onto the short list of things I need to look into.