(self, i)
Returns a single item, a row or a column of the matrix

        @param i: if a single integer, returns the M{i}th row as a list. If a
          slice, returns the corresponding rows as another L{Matrix} object. If
          a 2-tuple, the first element of the tuple is used to select a row and
          the second is used to select a column.
Returns a single item, a row or a column of the matrix
Returns a single item a row or a column of the matrix
def __getitem__(self, i):
        """Returns a single item, a row or a column of the matrix

        @param i: if a single integer, returns the M{i}th row as a list. If a
          slice, returns the corresponding rows as another L{Matrix} object. If
          a 2-tuple, the first element of the tuple is used to select a row and
          the second is used to select a column.
        """
        if isinstance(i, int):
            return list(self._data[i])
        elif isinstance(i, slice):
            return self.__class__(self._data[i])
        elif isinstance(i, tuple):
            try:
                first = i[0]
            except IndexError:
                first = slice(None)
            try:
                second = i[1]
            except IndexError:
                second = slice(None)
            if type(first) == slice and type(second) == slice:
                return self.__class__(row[second] for row in self._data[first])
            elif type(first) == slice:
                return [row[second] for row in self._data[first]]
            else:
                return self._data[first][second]
        else:
            raise IndexError("invalid matrix index")
def __getitem__ ( self , i ) : if isinstance ( i , int ) : return list ( self . _data [ i ] ) elif isinstance ( i , slice ) : return self . __class__ ( self . _data [ i ] ) elif isinstance ( i , tuple ) : try : first = i [ 0 ] except IndexError : first = slice ( None ) try : second = i [ 1 ] except IndexError : second = slice ( None ) if type ( first ) == slice and type ( second ) == slice : return self . __class__ ( row [ second ] for row in self . _data [ first ] ) elif type ( first ) == slice : return [ row [ second ] for row in self . _data [ first ] ] else : return self . _data [ first ] [ second ] else : raise IndexError ( "invalid matrix index" )