>>> from distrep import disti >>> it=disti(iter([1])) >>> next(it) Traceback (most recent call last): File ... StopIteration >>> it=disti(iter([1, 1])) >>> next(it) 0 >>> next(it) Traceback (most recent call last): File ... StopIteration >>> it=disti(iter([1, 2, 3, 4])) >>> next(it) Traceback (most recent call last): File ... StopIteration >>> it=disti(iter([1, 2, 3, 1])) >>> next(it) 2 >>> next(it) Traceback (most recent call last): File ... StopIteration --ini-enunciat >>> it=iter([1,2, 3, 4, 3, 2, 1, 1, 0, 1, 2, 5, 6, 5, 4, 2, 1]) >>> g = disti(it) >>> next(g) 5 >>> next(g) 0 >>> next(g) 1 >>> next(g) 6 --fi-enunciat >>> next(g) # doctest: +ELLIPSIS Traceback (most recent call last): File ... StopIteration