def set_result(self, result):
        """Sets the return value of work associated with the future.
        Only called internally.
        """
        with self.__condition:
            self.__result = result
            self.__state = FINISHED
            self.__condition.notify_all()
        self._invoke_callbacks()
Sets the return value of work associated with the future.
        Only called internally.