class ChessBoard(object):

    def __init__(self):
        self.squares = [None] * 64

def __setitem__(self, key, value):
    row, col = key
self.squares[row * 8 + col] = value

def __getitem__(self, key):
    row, col = key
return self.squares[row * 8 + col]
Возврат lvalue из функции в python