class_docstr: This class is *almost* compatible with concurrent.futures.Future.
  
  Differences:
  
  - This class is not thread-safe.
  
  - result() and exception() do not take a timeout argument and
    raise an exception when the future isn't done yet.
  
  - Callbacks registered with add_done_callback() are always called
    via the event loop's call_soon().
  
  - This class is not compatible with the wait() and as_completed()
    methods in the concurrent.futures package.
  
  (In Python 3.4 or later we may be able to unify the implementations.)
class_docstr_tok: ["This","class","is","*","almost","*","compatible","with","concurrent.futures.Future",".","Differences",":","-","This","class","is","not","thread-safe",".","-","result","(",")","and","exception","(",")","do","not","take","a","timeout","argument","and","raise","an","exception","when","the","future","is","n't","done","yet",".","-","Callbacks","registered","with","add_done_callback","(",")","are","always","called","via","the","event","loop","'s","call_soon","(",")",".","-","This","class","is","not","compatible","with","the","wait","(",")","and","as_completed","(",")","methods","in","the","concurrent.futures","package",".","(","In","Python","3.4","or","later","we","may","be","able","to","unify","the","implementations",".",")"]
docstr: Mark the future done and set its result.
  
  If the future is already done when this method is called, raises
  InvalidStateError.
docstr_tok: ["Mark","the","future","done","and","set","its","result",".","If","the","future","is","already","done","when","this","method","is","called",",","raises","InvalidStateError","."]
code: 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()
  
imports: import concurrent.futures
  import contextvars
  import logging
  import sys
  from types import GenericAlias
  from .None import base_futures
  from .None import events
  from .None import exceptions
  from .None import format_helpers
label_desc: Use image node_id 16 for calling the Future obj's underlying member method code with example usage: obj.set_result(result) without return types