Aaron Brady wrote:
I guess a generator that counts, but skips K numbers, where K can be varied. For instance, you initialize it with N, the starting number, and K, the jump size. Then, you can change either one later on.
This specification is incomplete as to the timing of when changes to N take effect and when variable K is applied.
This gets two birds with one stone, but is it possible?
If you write an iterator class instead of trying to stretch the abbreviated form beyond its intention, and the specification is coherent, it should be trivial.
-- http://mail.python.org/mailman/listinfo/python-list