This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients matrixise, socketpair, yselivanov
Date 2017-07-25.15:34:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1500996851.55.0.781833832187.issue31033@psf.upfronthosting.co.za>
In-reply-to
Content
> Will it cancel whole chain of depending futures in a RIGHT way ?

I was thinking about this:

  def Future.set_exception(exc):
      if isinstance(exc, asyncio.CancelledError):
          return self._cancel(exc)
      # here goes old code

  def Future.cancel():
      return self._cancel(asyncio.CancelledError())

Although now, that I'm looking at it, I don't like this idea, because setting as exception is a different operation from cancelling a task/future, and we shouldn't mix them.  It's OK to set a CancelledError without cancelling.  Also this would be a backwards incompatible change.

So back to square one -- we can consider passing extra args to .cancel() methods.
History
Date User Action Args
2017-07-25 15:34:11yselivanovsetrecipients: + yselivanov, socketpair, matrixise
2017-07-25 15:34:11yselivanovsetmessageid: <1500996851.55.0.781833832187.issue31033@psf.upfronthosting.co.za>
2017-07-25 15:34:11yselivanovlinkissue31033 messages
2017-07-25 15:34:11yselivanovcreate