Yielding a chain of values

aurora00 at gmail.com aurora00 at gmail.com
Fri Sep 9 18:57:18 CEST 2005

>>unless you are going many levels deep
(and that's usually a design smell of some kind)

No, its not a bug. its a feature! See the discussion in the recursive
generator thread below:


In my opinion, traversing recursive data structure is where generator
shine best. Alternative implementation using iterator is lot more
difficult and lot less elegant. Unfortunate the right now recursive
generator would carry a price tag of O(n^2) to the level of depth.

More information about the Python-list mailing list