[Python-ideas] Deterministic iterator cleanup

Yury Selivanov yselivanov.ml at gmail.com
Wed Oct 19 18:57:52 EDT 2016



On 2016-10-19 6:07 PM, Paul Moore wrote:
> I missed that you propose phasing this in, but it doesn't really alter
> much, I think the current behaviour is valuable and common, and I'm -1
> on breaking it. It's just too much of a fundamental change to how
> loops and iterators interact for me to be comfortable with it -
> particularly as it's only needed for a very specific use case (none of
> my programs ever use async - why should I have to rewrite my loops
> with a clumsy extra call just to cater for a problem that only occurs
> in async code?)

If I understand Nathaniel's proposal, fixing 'async for' isn't the only 
motivation.  Moreover, async generators aren't that different from sync 
generators in terms of finalization.

Yury


More information about the Python-ideas mailing list