release 0.6 comes with an experimental model for building generator-based exercises
we have 2 different and complementary mechanisms to limit / select output from the generator flow
max_iterations is set on the exercise instance; it acts more like an antiloop, and allows to limit the amount of iterations done no matter what
islice is set on the GeneratorArgs object and allows to select only a selection of the flow; designed to inspect for example the 1000-th iteration, within the same exercise and same actual parameters passed to the gen-func
within 0.6.0 these 2 mechanisms do not cohabit very nicely; when testing primes() with max_iterations=10_000 everything becomes super-slow
the point is that we need to call list() on the generator output rather early in the process - so that comparisons do the right thing - and it is very likely the point where things go wrong
release 0.6 comes with an experimental model for building generator-based exercises
we have 2 different and complementary mechanisms to limit / select output from the generator flow
max_iterationsis set on the exercise instance; it acts more like an antiloop, and allows to limit the amount of iterations done no matter whatisliceis set on theGeneratorArgsobject and allows to select only a selection of the flow; designed to inspect for example the 1000-th iteration, within the same exercise and same actual parameters passed to the gen-funcwithin 0.6.0 these 2 mechanisms do not cohabit very nicely; when testing
primes()withmax_iterations=10_000everything becomes super-slowthe point is that we need to call
list()on the generator output rather early in the process - so that comparisons do the right thing - and it is very likely the point where things go wrong