예제 #1
0
 def __getitem__(self, i):
     if 0 <= i < len(self):
         return API.getEntry(self._vector, i)
     else:
         raise IndexError
예제 #2
0
 def __getitem__(self, ij):
     i, j = ij
     return API.getEntry(self._matrix, i, j)