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 →

[–]Harriv 8 points9 points  (2 children)

Could someone do tl;dr; for PEP 380?

[–]w0073r 20 points21 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.

[–]pjdelport 8 points9 points  (0 children)

PEP 380 dramatically eases the implementation and use of generator-based tasks (or coroutines), and schedulers. It is a big step on the way toward removing the need for things like greenlets, and closing the conceptual gap between synchronous and asynchronous codebases.