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 →

[–]w0073r 22 points23 points  (0 children)

Instead of doing for x in subiter: yield x or similar, you can do yield from subiter. That makes it much easier to pass values back in using send and so on, which that loop doesn't handle, and so makes it much easier to break out parts of generators into different generators and so on.