MCPcopy Create free account
hub / github.com/ActiveState/code / __add__

Method __add__

recipes/Python/498272_Rich_iterator_wrapper/recipe-498272.py:21–25  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

19 def next(self): return self._it.next()
20
21 def __add__(self, other):
22 if not isinstance(other,Iter):
23 raise TypeError('can only add Iter (not "%s") to Iter' %
24 other.__class__.__name__)
25 return Iter(chain(self._it, other._it))
26
27 def __mul__(self, num): return Iter(chain(*tee(self._it,num)))
28 __rmul__ = __mul__

Callers

nothing calls this directly

Calls 1

IterClass · 0.85

Tested by

no test coverage detected