Yes it is really pulling a syntactic trick and not comparing against bools.  From the docs:<p>Comparisons can be chained arbitrarily, e.g., x &#60; y &#60;= z is equivalent to x &#60; y and y &#60;= z, except that y is evaluated only once.<p><a href="http://docs.python.org/reference/expressions.html#notin" rel="nofollow">http://docs.python.org/reference/expressions.html#notin</a>