utils.py
changeset 9821 2077c8da1893
parent 9780 8e687be43d84
child 10004 acad42456767
equal deleted inserted replaced
9819:95902c0b991b 9821:2077c8da1893
   166         self._item = item
   166         self._item = item
   167     def __repr__(self):
   167     def __repr__(self):
   168         return '<cubicweb.utils.RepeatList at %s item=%s size=%s>' % (
   168         return '<cubicweb.utils.RepeatList at %s item=%s size=%s>' % (
   169             id(self), self._item, self._size)
   169             id(self), self._item, self._size)
   170     def __len__(self):
   170     def __len__(self):
   171         return self._size
       
   172     def __nonzero__(self):
       
   173         return self._size
   171         return self._size
   174     def __iter__(self):
   172     def __iter__(self):
   175         return repeat(self._item, self._size)
   173         return repeat(self._item, self._size)
   176     def __getitem__(self, index):
   174     def __getitem__(self, index):
   177         return self._item
   175         return self._item