I recommend using [pylint](http://www.pylint.org/) to catch stuff like this.