Walking deeply nested lists

donn donn.ingle at gmail.com
Sat Aug 28 09:37:44 CEST 2010

On 28/08/2010 09:21, Arnaud Delobelle wrote:

> This flattens the list in the flatwalk method (which IMHO it should
> do given its name!):
Heh, I often name things ahead of my actual capacity to implement them!

> el is child.flatwalk():
Ah, I see what you mean. I think 'is' is 'in', but I kind of get the idea.

> This turns it into a generator method:
And thanks for the generator versions too. I shall hack them in and poke
them with a stick.

> Of course, for the above to work, "leaf" objects need a modified
> flatwalk method, e.g.:
Yes, My 'stubs' (leaves) do have such, but I will edit to use yield.

Thanks a mill.

More information about the Python-list mailing list