Python Test If Variable Is Boolean