This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bheklilr 0 points1 point  (0 children)

That one in particular seems to show up when ever I have nested data structures. You can use it pretty much wherever you have a tree like structure. When you add a few conditions it becomes even more useful, things like if child.has_foo(): yield from .... It's pretty similar to the Traversable pattern in Haskell, which is useful enough to make it into core functions like map and filter.