Exemplo n.º 1
0
 def __getitem__(self, idx):
     if isinstance(idx, types.SliceType):
         return self._slice(idx)
     idx = normalize_idx(idx, self.count)
     if self.count > idx:
         return self.node, self.kind, self.date, self._file
     raise IndexError
Exemplo n.º 2
0
 def __getitem__(self, idx):
     if isinstance(idx, types.SliceType):
         raise NotImplementedError("Not implemented")
     idx = normalize_idx(idx, self.count)
     if self.count > idx:
         return self._nodes[idx], self._kinds[idx], self._dates[idx], \
             self._files[idx]
     raise IndexError
Exemplo n.º 3
0
 def __getitem__(self, idx):
     if isinstance(idx, types.SliceType):
         return self._slice(idx)
     idx = normalize_idx(idx, self.count)
     if self.impls:
         at = 0
         impl = self.impls[at]
         while impl.count <= idx:
             at += 1
             idx -= impl.count
             impl = self.impls[at]
         return impl[idx]
     raise IndexError