#!/usr/bin/env python3
#
# day4-ex3.py - Chebyshev evaluation

class ChebyshevIterator:
    def __init__(self, x, stop = 10):
        self._prev = 1
        self._cur = x
        self._twox = 2 * x
        self._stop = stop
    def __iter__(self):
        return self
    def __next__(self):
        tmp = self._prev
        self._prev = self._cur
        self._cur = self._twox * self._prev - tmp
        if 0 == self._stop:
            raise StopIteration
        self._stop = self._stop - 1
        return tmp

Tix = [ x for x in ChebyshevIterator(0.1, 10) ]
print(Tix)
