(self, result)
Mark the future done and set its result.

        If the future is already done when this method is called, raises
        InvalidStateError.
Mark the future done and set its result.
Mark the future done and set its result .
def set_result(self, result):
        """Mark the future done and set its result.

        If the future is already done when this method is called, raises
        InvalidStateError.
        """
        if self._state != _PENDING:
            raise exceptions.InvalidStateError(f'{self._state}: {self!r}')
        self._result = result
        self._state = _FINISHED
        self.__schedule_callbacks()
def set_result ( self , result ) : if self . _state != _PENDING : raise exceptions . InvalidStateError ( f'{self._state}: {self!r}' ) self . _result = result self . _state = _FINISHED self . __schedule_callbacks ( )