Nitpicking: I think using != will be more familiar to the readers, as per http://docs.python.org/2/reference/lexical_analysis.html?highlight=comparison#operators