class documentation
class Progression:
Known subclasses: dsap.oop.progressions.ArithmeticProgression
, dsap.oop.progressions.FibonacciProgression
, dsap.oop.progressions.GeometricProgression
Iterator producing a generic progression.
Default iterator produces the whole numbers 0, 1, 2, ...
Method | __init__ |
Initialize current to the first value of the progression. |
Method | __iter__ |
By convention, an iterator must return itself as an iterator. |
Method | __next__ |
Return the next element, or else raise StopIteration error. |
Method | print |
Print next n values of the progression. |
Method | _advance |
Update self._current to a new value. |
Instance Variable | _current |
Undocumented |
overridden in
dsap.oop.progressions.ArithmeticProgression
, dsap.oop.progressions.FibonacciProgression
, dsap.oop.progressions.GeometricProgression
Initialize current to the first value of the progression.
overridden in
dsap.oop.progressions.ArithmeticProgression
, dsap.oop.progressions.FibonacciProgression
, dsap.oop.progressions.GeometricProgression
Update self._current to a new value.
This should be overridden by a subclass to customize progression.
By convention, if current is set to None, this designates the end of a finite progression.