Already resolved :class:`~concurrent.futures.Future` object. Users should treat this class as just another :class:`~concurrent.futures.Future`, the difference being an implementation detail: :class:`Present` is "resolved" at construction time.
| 119 | |
| 120 | |
| 121 | class Present(concurrent.futures.Future): |
| 122 | """Already resolved :class:`~concurrent.futures.Future` object. |
| 123 | |
| 124 | Users should treat this class as just another |
| 125 | :class:`~concurrent.futures.Future`, the difference being an implementation |
| 126 | detail: :class:`Present` is "resolved" at construction time. |
| 127 | """ |
| 128 | |
| 129 | def __init__(self, result=None, exception=None): |
| 130 | super().__init__() |
| 131 | if result is not None: |
| 132 | self.set_result(result) |
| 133 | elif exception is not None: |
| 134 | self.set_exception(exception) |
| 135 | else: |
| 136 | raise ValueError("can't provide both 'result' and 'exception'") |
no outgoing calls