It will be a very rare case — you need a generator that produces an infinite 
series of values with a try..finally block.

If I'm not mistaken it'll be any generator with `break` before it yieldedlast value(and with try...finally block that is usually context manager).

   def gen():
   async with cm_long_aexit():
   yield 1
   yield 2
   yield 3

   async for i in gen():
   if i == 2: break


We can maintain a weak set of ‘aclose’ tasks in the event loop, and make it a 
public and documented property.  That way you’ll be able to call gather() with 
a timeout on that list before closing the loop.

It solves the issue.
_______________________________________________
Async-sig mailing list
Async-sig@python.org
https://mail.python.org/mailman/listinfo/async-sig
Code of Conduct: https://www.python.org/psf/codeofconduct/

Reply via email to