Chris Jerdonek <chris.jerdo...@gmail.com> added the comment:

> Well, if you want to unconditionally end tasks you shouldn't write coroutines 
> that ignore CancelledErrors.

Well, of course. But code can have bugs, and maybe you didn't write the 
coroutine because it's from a library that you don't control. In that case, you 
should still be able to end the task. Also, maybe the coroutine doesn't have a 
bug but the cancellation is just taking longer than you have time for, so you 
want to end it early.

> So what are those real-world cases that can explain why asyncio should 
> support this functionality?

The case I had in mind was the one I referenced above -- being able to 
distinguish a normal CancelledError from one where you had interrupt the 
cancellation (i.e. cancellation timing out). I would like the caller to be able 
to know when the latter are happening.

----------

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

Reply via email to