Kyle Stanley <aeros...@gmail.com> added the comment:
Thank you for the bug report Timm. While I can certainly understand the source of the confusion here, I think you may be misunderstanding an important part of cancellation for futures. Specifically a future can't be cancelled once it reaches the PENDING state, this is indicated when future.cancel() returns false; see https://github.com/python/cpython/blob/0e96c419d7287c3c7f155c9f2de3c61020386256/Lib/asyncio/futures.py#L152 for the source code. In your example code snippet, you can also see this if you replace the line: ``` future_gather.cancel() ``` with the following: ``` if not future_gather.cancel(): logger.info("future_gather could not be cancelled") ``` Also, to clarify on something else: > However, my understanding is that asyncio.gather() is scheduled for > deprecation, so maybe changes in this area are on halt anyways!? asyncio.gather() is not deprecated or scheduled for deprecation, it is simply the loop argument being deprecated. ---------- nosy: +aeros _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40894> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com