Nathaniel Smith added the comment:

To make sure I understand correctly: your concern is that the event loop is not 
implemented in C. So if you have this patch + an async CM that's implemented in 
C + the async CM never *actually* yields to the event loop, then that will be 
signal safe... but that last restriction is pretty silly, because what's the 
point of an async CM that never yields to the event loop. Right?

I see what you mean, but I think this patch is still useful even if it doesn't 
protect the event loop itself. To get the full benefit, you also need some way 
to protect your event loop from unexpected KeyboardInterrupt, but that's 
something Trio already solves and asyncio potentially could. And we knew from 
the start that to get the *most* benefit from this patch we would also need 
some way to protect arbitrary chunks of Python code from KeyboardInterrupt so 
you could protect the __(a)exit__ method itself; needing to protect the loop 
too isn't a huge stretch beyond that.

(It's possible that enough of uvloop is implemented in C to benefit from this?)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to