':param int start: integer to stat yielding from.
:param int end: integer to end yielding at (exclusive).
:param int failure_between_chunks: number of times to
fail before starting to yield numbers from next chunk.
:param int chunk_num_to_fail_on:  If not None, fail only
after this chunk.  Do not fail between other chunks.'

def __init__(self, start, end, failures_between_chunks=0, chunk_num_to_fail_on=None):

    self.start = start
    self.end = end
    self.failures_between_chunks = failures_between_chunks
    self.chunk_num_to_fail_on = chunk_num_to_fail_on
    self._sort = 'ascending'
    self._rules = []
    self.current_chunk = 0
    self.num_after_was_called = 0
    self.total_num_failed = 0
    self.num_failed = 0
    self.should_fail = False
    self._reset_state()
