[Python-ideas] Async API

Yury Selivanov yselivanov.ml at gmail.com
Tue Oct 30 01:44:03 CET 2012


On 2012-10-29, at 8:06 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Yury Selivanov wrote:
>> Because scheduler, when it is deciding to interrupt a coroutine or not, should only question whether that particular coroutine is in its finally, and not the one which called it.
> 
> So given this:
> 
>   def c1():
>      try:
>         something()
>      finally:
>         yield from c2()
>         very_important_cleanup()
> 
>   def c2():
>      yield from block() # 1
> 
> it should be okay to interrupt at point 1, even though
> it will prevent very_important_cleanup() from being done?
> 
> That doesn't seem right to me.
> 
> -- 
> Greg
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas




More information about the Python-ideas mailing list