Use explicits comparisons such if (new_board is not None): or if (new_board is True):