Python Forum

Full Version: recusive generator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have an algorithm i want to implement. it produces a sequence of number pairs in some order, hence a generator seems to be the way to go. a variant of the algorithm produces the number pairs in a special order i want. this variant is also recursive. how would you do recursion as a generator?
What are these pairs of numbers, the algorithm and the special order that you want? We may be able to help if we have sufficient information.
this is some computer art. the number sequences draw the art. tweaking the algorithm changes the art. my focus is getting the code organized as a generator.

can a class method be a generator?