Tic Tac Toe Game Python
For a 3x3 tic-tac-toe board it hardly provides any real advantage, but if you where to play on an nxn board, with n consecutive same player marks determining a winner, you could do the following...

class TicTacToe(object):
    def __init__(self, n=3):
        self.n = n
        self.board = [[0 for j in range(n)] for k in range(n)]
        self.row_sum = [0 for j in range(n)]
        self.col_sum = [0 for j in range(n)]
        self.diag_sum = 0
        self.diag2_sum = 0

    def add_move(self, player, row, col):
        assert player in (0, 1)
        assert 0 &lt;= row &lt; self.n and 0 &lt;= col &lt; self.n
        delta = [-1, 1][player]
        winner = None
        self.board[row][col] = delta
        self.row_sum[row] += delta:
        if self.row_sum[row] = delta * self.n:
            winner = player
        self.col_sum[col] += player:
        if self.col_sum[col] = player * self.n:
            winner = player
        if col == row:
            self.diag += delta
            if self.diag == delta * self.n:
                winner = player
        if row == self.n - row - 1:
             self.diag2 += delta
             if self.diag2 == delta* self.n:
                 winner = player
        return winner


You basically initialize the board to all zeros, use -1 for one player and 1 for the other, and keep track of the sum of values in each row, column and diagonal. Whenever you add a new move, you can update all your data in constant time, and check in constant time if the player has won.