(self)
return True
Cancel the future if possible.

        Returns True if the future was cancelled, False otherwise. A future
        cannot be cancelled if it is running or has already completed.
Cancel the future if possible.
Cancel the future if possible .
def cancel(self):
        """Cancel the future if possible.

        Returns True if the future was cancelled, False otherwise. A future
        cannot be cancelled if it is running or has already completed.
        """
        with self._condition:
            if self._state in [RUNNING, FINISHED]:
                return False

            if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
                return True

            self._state = CANCELLED
            self._condition.notify_all()

        self._invoke_callbacks()
        return True
def cancel ( self ) : with self . _condition : if self . _state in [ RUNNING , FINISHED ] : return False if self . _state in [ CANCELLED , CANCELLED_AND_NOTIFIED ] : return True self . _state = CANCELLED self . _condition . notify_all ( ) self . _invoke_callbacks ( ) return True