Python Truth Table Subexpressions